Title: [246478] trunk/Source/WebCore
- Revision
- 246478
- Author
- [email protected]
- Date
- 2019-06-16 12:32:52 -0700 (Sun, 16 Jun 2019)
Log Message
[LFC][IFC] Remove Line::Content::isVisuallyEmpty
https://bugs.webkit.org/show_bug.cgi?id=198892
<rdar://problem/51780345>
Reviewed by Antti Koivisto.
Instead of setting the isVisuallyEmpty flag, reset the line height to 0.
* layout/inlineformatting/InlineFormattingContextLineLayout.cpp:
(WebCore::Layout::InlineFormattingContext::LineLayout::createDisplayRuns const):
* layout/inlineformatting/InlineLine.cpp:
(WebCore::Layout::Line::close):
* layout/inlineformatting/InlineLine.h:
(WebCore::Layout::Line::Content::isEmpty const):
(WebCore::Layout::Line::Content::setBaseline):
(WebCore::Layout::Line::Content::isVisuallyEmpty const): Deleted.
(WebCore::Layout::Line::Content::setIsVisuallyEmpty): Deleted.
Modified Paths
Diff
Modified: trunk/Source/WebCore/ChangeLog (246477 => 246478)
--- trunk/Source/WebCore/ChangeLog 2019-06-16 19:30:46 UTC (rev 246477)
+++ trunk/Source/WebCore/ChangeLog 2019-06-16 19:32:52 UTC (rev 246478)
@@ -1,5 +1,25 @@
2019-06-16 Zalan Bujtas <[email protected]>
+ [LFC][IFC] Remove Line::Content::isVisuallyEmpty
+ https://bugs.webkit.org/show_bug.cgi?id=198892
+ <rdar://problem/51780345>
+
+ Reviewed by Antti Koivisto.
+
+ Instead of setting the isVisuallyEmpty flag, reset the line height to 0.
+
+ * layout/inlineformatting/InlineFormattingContextLineLayout.cpp:
+ (WebCore::Layout::InlineFormattingContext::LineLayout::createDisplayRuns const):
+ * layout/inlineformatting/InlineLine.cpp:
+ (WebCore::Layout::Line::close):
+ * layout/inlineformatting/InlineLine.h:
+ (WebCore::Layout::Line::Content::isEmpty const):
+ (WebCore::Layout::Line::Content::setBaseline):
+ (WebCore::Layout::Line::Content::isVisuallyEmpty const): Deleted.
+ (WebCore::Layout::Line::Content::setIsVisuallyEmpty): Deleted.
+
+2019-06-16 Zalan Bujtas <[email protected]>
+
[LFC] Add limited quirks mode to LayoutState.
https://bugs.webkit.org/show_bug.cgi?id=198881
<rdar://problem/51773229>
Modified: trunk/Source/WebCore/layout/inlineformatting/InlineFormattingContextLineLayout.cpp (246477 => 246478)
--- trunk/Source/WebCore/layout/inlineformatting/InlineFormattingContextLineLayout.cpp 2019-06-16 19:30:46 UTC (rev 246477)
+++ trunk/Source/WebCore/layout/inlineformatting/InlineFormattingContextLineLayout.cpp 2019-06-16 19:32:52 UTC (rev 246478)
@@ -311,7 +311,7 @@
// A line box is always tall enough for all of the boxes it contains.
// Ignore the initial strut.
- auto lineBox = Display::Rect { lineContent.logicalTop(), lineContent.logicalLeft(), 0, !lineContent.isVisuallyEmpty() ? lineContent.logicalHeight() : LayoutUnit { } };
+ auto lineBox = Display::Rect { lineContent.logicalTop(), lineContent.logicalLeft(), 0, lineContent.logicalHeight()};
// Create final display runs.
auto& lineRuns = lineContent.runs();
for (unsigned index = 0; index < lineRuns.size(); ++index) {
@@ -393,8 +393,7 @@
}
// FIXME linebox needs to be ajusted after content alignment.
m_formattingState.addLineBox({ lineBox, lineContent.baseline() });
- if (!lineContent.isVisuallyEmpty())
- alignRuns(m_formattingRoot.style().textAlign(), previousLineLastRunIndex.valueOr(-1) + 1, widthConstraint - lineContent.logicalWidth());
+ alignRuns(m_formattingRoot.style().textAlign(), previousLineLastRunIndex.valueOr(-1) + 1, widthConstraint - lineContent.logicalWidth());
}
static Optional<LayoutUnit> horizontalAdjustmentForAlignment(TextAlignMode align, LayoutUnit remainingWidth)
Modified: trunk/Source/WebCore/layout/inlineformatting/InlineLine.cpp (246477 => 246478)
--- trunk/Source/WebCore/layout/inlineformatting/InlineLine.cpp 2019-06-16 19:30:46 UTC (rev 246477)
+++ trunk/Source/WebCore/layout/inlineformatting/InlineLine.cpp 2019-06-16 19:32:52 UTC (rev 246478)
@@ -86,6 +86,11 @@
{
removeTrailingTrimmableContent();
if (!m_skipVerticalAligment) {
+ if (isVisuallyEmpty()) {
+ m_baseline = { };
+ m_contentLogicalHeight = { };
+ }
+
for (auto& run : m_content->runs()) {
LayoutUnit logicalTop;
auto& inlineItem = run->inlineItem;
@@ -121,7 +126,6 @@
run->logicalRect.setTop(logicalTop);
}
}
- m_content->setIsVisuallyEmpty(isVisuallyEmpty());
m_content->setLogicalRect({ logicalTop(), logicalLeft(), contentLogicalWidth(), logicalHeight() });
m_content->setBaseline(m_baseline);
return WTFMove(m_content);
Modified: trunk/Source/WebCore/layout/inlineformatting/InlineLine.h (246477 => 246478)
--- trunk/Source/WebCore/layout/inlineformatting/InlineLine.h 2019-06-16 19:30:46 UTC (rev 246477)
+++ trunk/Source/WebCore/layout/inlineformatting/InlineLine.h 2019-06-16 19:32:52 UTC (rev 246478)
@@ -60,8 +60,6 @@
using Runs = Vector<std::unique_ptr<Run>>;
const Runs& runs() const { return m_runs; }
bool isEmpty() const { return m_runs.isEmpty(); }
- // Not in painting sense though.
- bool isVisuallyEmpty() const { return m_isVisuallyEmpty; }
LayoutUnit logicalTop() const { return m_logicalRect.top(); }
LayoutUnit logicalLeft() const { return m_logicalRect.left(); }
@@ -76,13 +74,11 @@
void setLogicalRect(const Display::Rect& logicalRect) { m_logicalRect = logicalRect; }
void setBaseline(LineBox::Baseline baseline) { m_baseline = baseline; }
- void setIsVisuallyEmpty(bool isVisuallyEmpty) { m_isVisuallyEmpty = isVisuallyEmpty; }
Runs& runs() { return m_runs; }
Display::Rect m_logicalRect;
LineBox::Baseline m_baseline;
Runs m_runs;
- bool m_isVisuallyEmpty { true };
};
std::unique_ptr<Content> close();
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes