WebKit Bugzilla
Attachment 372210 Details for
Bug 198899
: [LFC][IFC] Use the borderBox rect consistently to size the inline box.
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-198899-20190615193923.patch (text/plain), 6.25 KB, created by
zalan
on 2019-06-15 19:39:23 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
zalan
Created:
2019-06-15 19:39:23 PDT
Size:
6.25 KB
patch
obsolete
>Subversion Revision: 246468 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index c43f0d610cc00d8ba081783d3f700b1acf4b9fc9..1ab2af960e3db027cbc8affff581ae42459eb7c1 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,24 @@ >+2019-06-15 Zalan Bujtas <zalan@apple.com> >+ >+ [LFC][IFC] Use the borderBox rect consistently to size the inline box. >+ https://bugs.webkit.org/show_bug.cgi?id=198899 >+ >+ Reviewed by NOBODY (OOPS!). >+ <rdar://problem/51781969> >+ >+ Use the margin box height (when applicable) to adjust the line height and use the borderBox rect (or font size) height to size the inline box. >+ >+ * layout/displaytree/DisplayBox.h: >+ (WebCore::Display::Box::borderBoxHeight const): >+ (WebCore::Display::Box::marginBoxHeight const): >+ * layout/inlineformatting/InlineLine.cpp: >+ (WebCore::Layout::Line::appendInlineContainerStart): >+ (WebCore::Layout::Line::appendTextContent): >+ (WebCore::Layout::Line::appendNonReplacedInlineBox): >+ (WebCore::Layout::Line::inlineItemContentHeight const): >+ (WebCore::Layout::Line::inlineItemHeight const): Deleted. >+ * layout/inlineformatting/InlineLine.h: >+ > 2019-06-15 Zalan Bujtas <zalan@apple.com> > > [LFC][IFC] Line::isVisuallyEmpty should check inline-block boxes. >diff --git a/Source/WebCore/layout/displaytree/DisplayBox.h b/Source/WebCore/layout/displaytree/DisplayBox.h >index 5cdf63bf779591a88e74823262a0a90c2197a4c0..4df01a3d208ceaf2296a146e2cbcb3e820329646 100644 >--- a/Source/WebCore/layout/displaytree/DisplayBox.h >+++ b/Source/WebCore/layout/displaytree/DisplayBox.h >@@ -119,7 +119,9 @@ public: > LayoutUnit paddingBoxHeight() const { return paddingTop().valueOr(0) + contentBoxHeight() + paddingBottom().valueOr(0); } > LayoutUnit paddingBoxWidth() const { return paddingLeft().valueOr(0) + contentBoxWidth() + paddingRight().valueOr(0); } > >+ LayoutUnit borderBoxHeight() const { return borderTop() + paddingBoxHeight() + borderBottom(); } > LayoutUnit borderBoxWidth() const { return borderLeft() + paddingBoxWidth() + borderRight(); } >+ LayoutUnit marginBoxHeight() const { return marginBefore() + borderBoxHeight() + marginAfter(); } > LayoutUnit marginBoxWidth() const { return marginStart() + borderBoxWidth() + marginEnd(); } > > Rect marginBox() const; >diff --git a/Source/WebCore/layout/inlineformatting/InlineLine.cpp b/Source/WebCore/layout/inlineformatting/InlineLine.cpp >index bfec8a8df1f9ecf1333e34d43d7767e290738d0e..9aedab13a14c56b048e653a4e1cf7611156fdb2f 100644 >--- a/Source/WebCore/layout/inlineformatting/InlineLine.cpp >+++ b/Source/WebCore/layout/inlineformatting/InlineLine.cpp >@@ -201,7 +201,7 @@ void Line::appendInlineContainerStart(const InlineItem& inlineItem, LayoutUnit l > logicalRect.setWidth(logicalWidth); > > if (!m_skipVerticalAligment) { >- auto logicalHeight = inlineItemHeight(inlineItem); >+ auto logicalHeight = inlineItemContentHeight(inlineItem); > adjustBaselineAndLineHeight(inlineItem, logicalHeight); > logicalRect.setHeight(logicalHeight); > } >@@ -248,7 +248,7 @@ void Line::appendTextContent(const InlineTextItem& inlineItem, LayoutUnit logica > logicalRect.setLeft(contentLogicalRight()); > logicalRect.setWidth(logicalWidth); > if (!m_skipVerticalAligment) >- logicalRect.setHeight(inlineItemHeight(inlineItem)); >+ logicalRect.setHeight(inlineItemContentHeight(inlineItem)); > > auto textContext = Content::Run::TextContext { inlineItem.start(), inlineItem.isCollapsed() ? 1 : inlineItem.length() }; > auto lineItem = std::make_unique<Content::Run>(inlineItem, logicalRect, textContext, isCompletelyCollapsed, canBeExtended); >@@ -268,9 +268,8 @@ void Line::appendNonReplacedInlineBox(const InlineItem& inlineItem, LayoutUnit l > logicalRect.setLeft(contentLogicalRight() + horizontalMargin.start); > logicalRect.setWidth(logicalWidth); > if (!m_skipVerticalAligment) { >- auto logicalHeight = inlineItemHeight(inlineItem); >- adjustBaselineAndLineHeight(inlineItem, logicalHeight); >- logicalRect.setHeight(logicalHeight); >+ adjustBaselineAndLineHeight(inlineItem, displayBox.marginBoxHeight()); >+ logicalRect.setHeight(inlineItemContentHeight(inlineItem)); > } > > m_content->runs().append(std::make_unique<Content::Run>(inlineItem, logicalRect, Content::Run::TextContext { }, false, false)); >@@ -344,7 +343,7 @@ void Line::adjustBaselineAndLineHeight(const InlineItem& inlineItem, LayoutUnit > } > } > >-LayoutUnit Line::inlineItemHeight(const InlineItem& inlineItem) const >+LayoutUnit Line::inlineItemContentHeight(const InlineItem& inlineItem) const > { > ASSERT(!m_skipVerticalAligment); > auto& fontMetrics = inlineItem.style().fontMetrics(); >@@ -356,16 +355,16 @@ LayoutUnit Line::inlineItemHeight(const InlineItem& inlineItem) const > auto& displayBox = m_layoutState.displayBoxForLayoutBox(layoutBox); > > if (layoutBox.isFloatingPositioned()) >- return displayBox.marginBox().height(); >+ return displayBox.borderBoxHeight(); > > if (layoutBox.isReplaced()) >- return displayBox.height(); >+ return displayBox.borderBoxHeight(); > > if (inlineItem.isContainerStart() || inlineItem.isContainerEnd()) > return fontMetrics.height() + displayBox.verticalBorder() + displayBox.verticalPadding().valueOr(0); > > // Non-replaced inline box (e.g. inline-block) >- return displayBox.marginBox().height(); >+ return displayBox.borderBoxHeight(); > } > > LineBox::Baseline Line::halfLeadingMetrics(const FontMetrics& fontMetrics, LayoutUnit lineLogicalHeight) >diff --git a/Source/WebCore/layout/inlineformatting/InlineLine.h b/Source/WebCore/layout/inlineformatting/InlineLine.h >index 7bb65f2330d457fc29a719692d8bbc3a57737607..08c1086749764724064121b836cc631dc294da1d 100644 >--- a/Source/WebCore/layout/inlineformatting/InlineLine.h >+++ b/Source/WebCore/layout/inlineformatting/InlineLine.h >@@ -118,7 +118,7 @@ private: > void removeTrailingTrimmableContent(); > > void adjustBaselineAndLineHeight(const InlineItem&, LayoutUnit runHeight); >- LayoutUnit inlineItemHeight(const InlineItem&) const; >+ LayoutUnit inlineItemContentHeight(const InlineItem&) const; > bool isVisuallyEmpty() const; > > const LayoutState& m_layoutState;
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
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 198899
: 372210