WebKit Bugzilla
Attachment 372615 Details for
Bug 199091
: [LFC][IFC] Adjust baseline top when the baseline moves.
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-199091-20190620211803.patch (text/plain), 4.29 KB, created by
zalan
on 2019-06-20 21:18:04 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
zalan
Created:
2019-06-20 21:18:04 PDT
Size:
4.29 KB
patch
obsolete
>Subversion Revision: 246633 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index d69fa0a5d008c9a708453d03d121a175d96ff417..47eaa037740a8073e2ad29ac5767ca3f31780519 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,17 @@ >+2019-06-20 Zalan Bujtas <zalan@apple.com> >+ >+ [LFC][IFC] Adjust baseline top when the baseline moves. >+ https://bugs.webkit.org/show_bug.cgi?id=199091 >+ <rdar://problem/51966257> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Currently only "text-align: bottom" adjusts the baseline top. This patch fixes the "text-align: baseline" case when >+ the growing ascent pushes the baseline top closer to the line top. >+ >+ * layout/inlineformatting/InlineLine.cpp: >+ (WebCore::Layout::Line::adjustBaselineAndLineHeight): >+ > 2019-06-20 Zalan Bujtas <zalan@apple.com> > > [LFC][IFC] LineBox::Baseline should have a height getter. >diff --git a/Source/WebCore/layout/inlineformatting/InlineLine.cpp b/Source/WebCore/layout/inlineformatting/InlineLine.cpp >index 1389c3471d7ef31d0d25231d53703a33b89378fd..f3a89cc812795d60a857566c702ded8bfec59d11 100644 >--- a/Source/WebCore/layout/inlineformatting/InlineLine.cpp >+++ b/Source/WebCore/layout/inlineformatting/InlineLine.cpp >@@ -313,6 +313,7 @@ void Line::adjustBaselineAndLineHeight(const InlineItem& inlineItem, LayoutUnit > auto& style = layoutBox.style(); > > if (inlineItem.isContainerStart()) { >+ // FIXME: This implies baseline vertical aligment for the inline container. > auto& fontMetrics = style.fontMetrics(); > auto halfLeading = halfLeadingMetrics(fontMetrics, style.computedLineHeight()); > if (halfLeading.descent > 0) >@@ -334,29 +335,30 @@ void Line::adjustBaselineAndLineHeight(const InlineItem& inlineItem, LayoutUnit > } > // Replaced and non-replaced inline level box. > switch (inlineItem.style().verticalAlign()) { >- case VerticalAlign::Baseline: >+ case VerticalAlign::Baseline: { >+ auto newBaselineCandidate = LineBox::Baseline { runHeight, 0 }; > if (layoutBox.isInlineBlockBox() && layoutBox.establishesInlineFormattingContext()) { > // Inline-blocks with inline content always have baselines. > auto& formattingState = downcast<InlineFormattingState>(m_layoutState.establishedFormattingState(layoutBox)); > // Spec makes us generate at least one line -even if it is empty. > ASSERT(!formattingState.lineBoxes().isEmpty()); >- auto inlineBlockBaseline = formattingState.lineBoxes().last().baseline(); >- m_baseline.descent = std::max(inlineBlockBaseline.descent, m_baseline.descent); >- m_baseline.ascent = std::max(inlineBlockBaseline.ascent, m_baseline.ascent); >- m_contentLogicalHeight = std::max(std::max(m_contentLogicalHeight, runHeight), m_baseline.height()); >- break; >+ newBaselineCandidate = formattingState.lineBoxes().last().baseline(); > } >- m_baseline.descent = std::max<LayoutUnit>(0, m_baseline.descent); >- m_baseline.ascent = std::max(runHeight, m_baseline.ascent); >- m_contentLogicalHeight = std::max(m_contentLogicalHeight, m_baseline.height()); >+ m_baseline.ascent = std::max(newBaselineCandidate.ascent, m_baseline.ascent); >+ m_baseline.descent = std::max(newBaselineCandidate.descent, m_baseline.descent); >+ m_contentLogicalHeight = std::max(std::max(m_contentLogicalHeight, runHeight), m_baseline.height()); >+ // Baseline ascent/descent never shrink -> max. >+ m_baselineTop = std::max(m_baselineTop, m_contentLogicalHeight - m_baseline.height()); > break; >+ } > case VerticalAlign::Top: > // Top align content never changes the baseline offset, it only pushes the bottom of the line further down. > m_contentLogicalHeight = std::max(runHeight, m_contentLogicalHeight); > break; > case VerticalAlign::Bottom: >- if (m_contentLogicalHeight < runHeight) { >- m_baselineTop += runHeight - m_contentLogicalHeight; >+ // Bottom aligned, tall content pushes the baseline further down from the line top. >+ if (runHeight > m_contentLogicalHeight) { >+ m_baselineTop += (runHeight - m_contentLogicalHeight); > m_contentLogicalHeight = runHeight; > } > break;
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Flags:
koivisto
:
review+
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 199091
: 372615