WebKit Bugzilla
Attachment 372201 Details for
Bug 198893
: [LFC][IFC] Ignore descent when in limited quirks mode
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-198893-20190615164214.patch (text/plain), 4.24 KB, created by
zalan
on 2019-06-15 16:42:14 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
zalan
Created:
2019-06-15 16:42:14 PDT
Size:
4.24 KB
patch
obsolete
>Subversion Revision: 246468 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index 7fdbd5426597153eb5d3f4ddd9cd7b87b24aa79b..207d6627ad65528293e833735fbb86f175eb3a80 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,19 @@ >+2019-06-15 Zalan Bujtas <zalan@apple.com> >+ >+ [LFC][IFC] Ignore descent when in limited/full quirks mode >+ https://bugs.webkit.org/show_bug.cgi?id=198893 >+ <rdar://problem/51780634> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ In limited/full quirks mode, line's descent should be ignored when computing the final line height when >+ 1. the line has baseline aligned content only and >+ 2. these baseline aligned boxes don't have descent. >+ >+ * layout/inlineformatting/InlineLine.cpp: >+ (WebCore::Layout::Line::isVisuallyEmpty const): >+ (WebCore::Layout::Line::close): >+ > 2019-06-15 Zalan Bujtas <zalan@apple.com> > > [LFC][IFC] Remove Line::Content::isVisuallyEmpty >diff --git a/Source/WebCore/layout/inlineformatting/InlineLine.cpp b/Source/WebCore/layout/inlineformatting/InlineLine.cpp >index 58f94c6a0913815ce62004611a63e92efca77edc..9f492a82e90db626c2a1c69ba3a8377ce010cca1 100644 >--- a/Source/WebCore/layout/inlineformatting/InlineLine.cpp >+++ b/Source/WebCore/layout/inlineformatting/InlineLine.cpp >@@ -91,25 +91,31 @@ std::unique_ptr<Line::Content> Line::close() > m_contentLogicalHeight = { }; > } > >+ auto hasDescent = false; >+ auto hasNonBaselineAlignedContent = false; > for (auto& run : m_content->runs()) { > LayoutUnit logicalTop; > auto& inlineItem = run->inlineItem; > auto& layoutBox = inlineItem.layoutBox(); >+ auto verticalAlign = inlineItem.style().verticalAlign(); > auto ascent = inlineItem.style().fontMetrics().ascent(); > >- switch (inlineItem.style().verticalAlign()) { >+ switch (verticalAlign) { > case VerticalAlign::Baseline: >- if (inlineItem.isLineBreak() || inlineItem.isText()) >+ if (inlineItem.isLineBreak() || inlineItem.isText()) { > logicalTop = baselineOffset() - ascent; >- else if (inlineItem.isContainerStart()) { >+ hasDescent = hasDescent || !run->isCollapsed; >+ } else if (inlineItem.isContainerStart()) { > auto& displayBox = m_layoutState.displayBoxForLayoutBox(layoutBox); > logicalTop = baselineOffset() - ascent - displayBox.borderTop() - displayBox.paddingTop().valueOr(0); >+ hasDescent = hasDescent || (displayBox.horizontalBorder() || (displayBox.horizontalPadding() && displayBox.horizontalPadding().value())); > } else if (layoutBox.isInlineBlockBox() && layoutBox.establishesInlineFormattingContext()) { > 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(); > logicalTop = baselineOffset() - inlineBlockBaseline.ascent; >+ hasDescent = hasDescent || inlineBlockBaseline.descent; > } else > logicalTop = baselineOffset() - run->logicalRect.height(); > break; >@@ -123,8 +129,14 @@ std::unique_ptr<Line::Content> Line::close() > ASSERT_NOT_IMPLEMENTED_YET(); > break; > } >+ hasNonBaselineAlignedContent = hasNonBaselineAlignedContent || verticalAlign != VerticalAlign::Baseline; > run->logicalRect.setTop(logicalTop); > } >+ // Remove descent when all content is baseline aligned but none of them have descent. >+ if (!m_layoutState.inNoQuirksMode() && !hasNonBaselineAlignedContent && !hasDescent) { >+ m_contentLogicalHeight -= m_baseline.descent; >+ m_baseline.descent = { }; >+ } > } > m_content->setLogicalRect({ logicalTop(), logicalLeft(), contentLogicalWidth(), logicalHeight() }); > m_content->setBaseline(m_baseline);
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 198893
: 372201