WebKit Bugzilla
Attachment 371196 Details for
Bug 198489
: [LFC][IFC] Remove redundant InlineItem::width() calls.
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-198489-20190603110045.patch (text/plain), 6.61 KB, created by
zalan
on 2019-06-03 11:00:46 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
zalan
Created:
2019-06-03 11:00:46 PDT
Size:
6.61 KB
patch
obsolete
>Subversion Revision: 246027 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index 196d2609c9e3d7207ffa92d1da2ea763f36a2105..60c9a73dc433c8da554b7d3dd326849b796572f8 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,22 @@ >+2019-06-03 Zalan Bujtas <zalan@apple.com> >+ >+ [LFC][IFC] Remove redundant InlineItem::width() calls. >+ https://bugs.webkit.org/show_bug.cgi?id=198489 >+ <rdar://problem/51360390> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ This is in preparation for removing InlineItem::width(). >+ >+ * layout/inlineformatting/InlineFormattingContextLineLayout.cpp: >+ (WebCore::Layout::InlineFormattingContext::LineLayout::handleFloat const): >+ (WebCore::Layout::InlineFormattingContext::LineLayout::commitInlineItemToLine const): >+ * layout/inlineformatting/InlineLine.cpp: >+ (WebCore::Layout::Line::appendNonBreakableSpace): >+ (WebCore::Layout::Line::appendInlineContainerStart): >+ (WebCore::Layout::Line::appendInlineContainerEnd): >+ * layout/inlineformatting/InlineLine.h: >+ > 2019-06-01 Simon Fraser <simon.fraser@apple.com> > > [Async overflow scroll] Flashing content when scrolling async overflow with a negative z-index child >diff --git a/Source/WebCore/layout/inlineformatting/InlineFormattingContextLineLayout.cpp b/Source/WebCore/layout/inlineformatting/InlineFormattingContextLineLayout.cpp >index fb64e2c97742df1fdab9d622b84399687a28c40e..8f78cafeedd375fc2db310e399e9cc77c9f275ec 100644 >--- a/Source/WebCore/layout/inlineformatting/InlineFormattingContextLineLayout.cpp >+++ b/Source/WebCore/layout/inlineformatting/InlineFormattingContextLineLayout.cpp >@@ -340,27 +340,31 @@ void InlineFormattingContext::LineLayout::handleFloat(Line& line, const Floating > displayBox.setTopLeft(floatingContext.positionForFloat(floatBox)); > m_floatingState.append(floatBox); > // Shrink availble space for current line and move existing inline runs. >- auto floatBoxWidth = floatItem.width(); >+ auto floatBoxWidth = displayBox.marginBoxWidth(); > floatBox.isLeftFloatingPositioned() ? line.moveLogicalLeft(floatBoxWidth) : line.moveLogicalRight(floatBoxWidth); > } > > void InlineFormattingContext::LineLayout::commitInlineItemToLine(Line& line, const InlineItem& inlineItem) const > { >- if (inlineItem.isContainerStart()) >- return line.appendInlineContainerStart(inlineItem); >- >- if (inlineItem.isContainerEnd()) >- return line.appendInlineContainerEnd(inlineItem); >- > if (inlineItem.isHardLineBreak()) > return line.appendHardLineBreak(inlineItem); > > auto width = inlineItem.width(); >+ auto& fontMetrics = inlineItem.style().fontMetrics(); > if (is<InlineTextItem>(inlineItem)) >- return line.appendTextContent(downcast<InlineTextItem>(inlineItem), { width, inlineItem.style().fontMetrics().height() }); >+ return line.appendTextContent(downcast<InlineTextItem>(inlineItem), { width, fontMetrics.height() }); > > auto& layoutBox = inlineItem.layoutBox(); > auto& displayBox = layoutState().displayBoxForLayoutBox(layoutBox); >+ >+ if (inlineItem.isContainerStart()) { >+ auto containerHeight = fontMetrics.height() + displayBox.verticalBorder() + displayBox.verticalPadding().valueOr(0); >+ return line.appendInlineContainerStart(inlineItem, { width, containerHeight }); >+ } >+ >+ if (inlineItem.isContainerEnd()) >+ return line.appendInlineContainerEnd(inlineItem, { width, 0 }); >+ > if (layoutBox.isReplaced()) > return line.appendReplacedInlineBox(inlineItem, { width, displayBox.height() }); > >diff --git a/Source/WebCore/layout/inlineformatting/InlineLine.cpp b/Source/WebCore/layout/inlineformatting/InlineLine.cpp >index a55e014c0f9cc2da5fcebcb8446caba3c852c33b..2f0f5d5c096b69ad7be034c27bd21443de781537 100644 >--- a/Source/WebCore/layout/inlineformatting/InlineLine.cpp >+++ b/Source/WebCore/layout/inlineformatting/InlineLine.cpp >@@ -116,10 +116,10 @@ LayoutUnit Line::trailingTrimmableWidth() const > void Line::appendNonBreakableSpace(const InlineItem& inlineItem, const Display::Rect& logicalRect) > { > m_content->runs().append(std::make_unique<Content::Run>(Display::Run { logicalRect }, inlineItem, false, false)); >- m_contentLogicalWidth += inlineItem.width(); >+ m_contentLogicalWidth += logicalRect.width(); > } > >-void Line::appendInlineContainerStart(const InlineItem& inlineItem) >+void Line::appendInlineContainerStart(const InlineItem& inlineItem, LayoutSize runSize) > { > auto& layoutBox = inlineItem.layoutBox(); > auto& style = layoutBox.style(); >@@ -137,16 +137,15 @@ void Line::appendInlineContainerStart(const InlineItem& inlineItem) > > alignAndAdjustLineHeight(); > auto& displayBox = m_layoutState.displayBoxForLayoutBox(layoutBox); >- auto containerHeight = fontMetrics.height() + displayBox.verticalBorder() + displayBox.verticalPadding().valueOr(0); > auto logicalTop = -fontMetrics.ascent() - displayBox.borderTop() - displayBox.paddingTop().valueOr(0); >- auto logicalRect = Display::Rect { logicalTop, contentLogicalRight(), inlineItem.width(), containerHeight }; >+ auto logicalRect = Display::Rect { logicalTop, contentLogicalRight(), runSize.width(), runSize.height() }; > appendNonBreakableSpace(inlineItem, logicalRect); > } > >-void Line::appendInlineContainerEnd(const InlineItem& inlineItem) >+void Line::appendInlineContainerEnd(const InlineItem& inlineItem, LayoutSize runSize) > { > // This is really just a placeholder to mark the end of the inline level container. >- auto logicalRect = Display::Rect { 0, contentLogicalRight(), inlineItem.width(), 0 }; >+ auto logicalRect = Display::Rect { 0, contentLogicalRight(), runSize.width(), runSize.height() }; > appendNonBreakableSpace(inlineItem, logicalRect); > } > >diff --git a/Source/WebCore/layout/inlineformatting/InlineLine.h b/Source/WebCore/layout/inlineformatting/InlineLine.h >index 61529fb4d0de0c99f09d9305e9ff681555a03a50..bca1bc732e88843fdf780c6c17a2323577122fd2 100644 >--- a/Source/WebCore/layout/inlineformatting/InlineLine.h >+++ b/Source/WebCore/layout/inlineformatting/InlineLine.h >@@ -78,8 +78,8 @@ public: > void appendTextContent(const InlineTextItem&, LayoutSize); > void appendNonReplacedInlineBox(const InlineItem&, LayoutSize); > void appendReplacedInlineBox(const InlineItem&, LayoutSize); >- void appendInlineContainerStart(const InlineItem&); >- void appendInlineContainerEnd(const InlineItem&); >+ void appendInlineContainerStart(const InlineItem&, LayoutSize); >+ void appendInlineContainerEnd(const InlineItem&, LayoutSize); > void appendHardLineBreak(const InlineItem&); > > bool hasContent() const { return !m_content->isVisuallyEmpty(); }
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 198489
: 371196