Title: [269149] trunk/Source/WebCore
Revision
269149
Author
[email protected]
Date
2020-10-29 08:51:07 -0700 (Thu, 29 Oct 2020)

Log Message

[LFC][Integration] Rename top/bottomWithLeading to lineBoxTop/Bottom
https://bugs.webkit.org/show_bug.cgi?id=218340

Reviewed by Zalan Bujtas.

These match the spec concept of line box.
For clarity rename the legacy fields and functions in RootInlineBox too.

* layout/integration/LayoutIntegrationLineIterator.h:
(WebCore::LayoutIntegration::PathLine::lineBoxTop const):
(WebCore::LayoutIntegration::PathLine::lineBoxBottom const):
(WebCore::LayoutIntegration::PathLine::topWithLeading const): Deleted.
(WebCore::LayoutIntegration::PathLine::bottomWithLeading const): Deleted.
* layout/integration/LayoutIntegrationLineIteratorLegacyPath.h:
(WebCore::LayoutIntegration::LineIteratorLegacyPath::lineBoxTop const):
(WebCore::LayoutIntegration::LineIteratorLegacyPath::lineBoxBottom const):
(WebCore::LayoutIntegration::LineIteratorLegacyPath::topWithLeading const): Deleted.
(WebCore::LayoutIntegration::LineIteratorLegacyPath::bottomWithLeading const): Deleted.
* layout/integration/LayoutIntegrationLineIteratorModernPath.h:
(WebCore::LayoutIntegration::LineIteratorModernPath::lineBoxTop const):
(WebCore::LayoutIntegration::LineIteratorModernPath::lineBoxBottom const):
(WebCore::LayoutIntegration::LineIteratorModernPath::topWithLeading const): Deleted.
(WebCore::LayoutIntegration::LineIteratorModernPath::bottomWithLeading const): Deleted.
* rendering/ComplexLineLayout.cpp:
(WebCore::ComplexLineLayout::layoutRunsAndFloatsInRange):
(WebCore::ComplexLineLayout::linkToEndLineIfNeeded):
(WebCore::ComplexLineLayout::checkFloatInCleanLine):
(WebCore::ComplexLineLayout::determineStartPosition):
(WebCore::ComplexLineLayout::determineEndPosition):
(WebCore::ComplexLineLayout::checkPaginationAndFloatsAtEndLine):
(WebCore::ComplexLineLayout::lineWidthForPaginatedLineChanged const):
(WebCore::ComplexLineLayout::matchedEndLine):
(WebCore::ComplexLineLayout::updateFragmentForLine const):
* rendering/RenderBlockFlow.cpp:
(WebCore::calculateMinimumPageHeight):
(WebCore::RenderBlockFlow::adjustLinePositionForPagination):
(WebCore::RenderBlockFlow::markLinesDirtyInBlockRange):
(WebCore::RenderBlockFlow::positionForPointWithInlineChildren):
* rendering/RenderBox.cpp:
(WebCore::RenderBox::positionLineBox):
* rendering/RenderLayoutState.cpp:
(WebCore::RenderLayoutState::computeLineGridPaginationOrigin):
* rendering/RenderLineBreak.cpp:
(WebCore::RenderLineBreak::collectSelectionRects):
* rendering/RenderText.cpp:
(WebCore::RenderText::collectSelectionRects):
* rendering/RootInlineBox.cpp:
(WebCore::RootInlineBox::adjustPosition):
(WebCore::RootInlineBox::alignBoxesInBlockDirection):
(WebCore::RootInlineBox::lineSnapAdjustment const):
(WebCore::RootInlineBox::outputLineBox const):
* rendering/RootInlineBox.h:
(WebCore::RootInlineBox::lineBoxTop const):
(WebCore::RootInlineBox::lineBoxBottom const):
(WebCore::RootInlineBox::setLineTopBottomPositions):
(WebCore::RootInlineBox::lineTopWithLeading const): Deleted.
(WebCore::RootInlineBox::lineBottomWithLeading const): Deleted.

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (269148 => 269149)


--- trunk/Source/WebCore/ChangeLog	2020-10-29 15:16:24 UTC (rev 269148)
+++ trunk/Source/WebCore/ChangeLog	2020-10-29 15:51:07 UTC (rev 269149)
@@ -1,5 +1,65 @@
 2020-10-29  Antti Koivisto  <[email protected]>
 
+        [LFC][Integration] Rename top/bottomWithLeading to lineBoxTop/Bottom
+        https://bugs.webkit.org/show_bug.cgi?id=218340
+
+        Reviewed by Zalan Bujtas.
+
+        These match the spec concept of line box.
+        For clarity rename the legacy fields and functions in RootInlineBox too.
+
+        * layout/integration/LayoutIntegrationLineIterator.h:
+        (WebCore::LayoutIntegration::PathLine::lineBoxTop const):
+        (WebCore::LayoutIntegration::PathLine::lineBoxBottom const):
+        (WebCore::LayoutIntegration::PathLine::topWithLeading const): Deleted.
+        (WebCore::LayoutIntegration::PathLine::bottomWithLeading const): Deleted.
+        * layout/integration/LayoutIntegrationLineIteratorLegacyPath.h:
+        (WebCore::LayoutIntegration::LineIteratorLegacyPath::lineBoxTop const):
+        (WebCore::LayoutIntegration::LineIteratorLegacyPath::lineBoxBottom const):
+        (WebCore::LayoutIntegration::LineIteratorLegacyPath::topWithLeading const): Deleted.
+        (WebCore::LayoutIntegration::LineIteratorLegacyPath::bottomWithLeading const): Deleted.
+        * layout/integration/LayoutIntegrationLineIteratorModernPath.h:
+        (WebCore::LayoutIntegration::LineIteratorModernPath::lineBoxTop const):
+        (WebCore::LayoutIntegration::LineIteratorModernPath::lineBoxBottom const):
+        (WebCore::LayoutIntegration::LineIteratorModernPath::topWithLeading const): Deleted.
+        (WebCore::LayoutIntegration::LineIteratorModernPath::bottomWithLeading const): Deleted.
+        * rendering/ComplexLineLayout.cpp:
+        (WebCore::ComplexLineLayout::layoutRunsAndFloatsInRange):
+        (WebCore::ComplexLineLayout::linkToEndLineIfNeeded):
+        (WebCore::ComplexLineLayout::checkFloatInCleanLine):
+        (WebCore::ComplexLineLayout::determineStartPosition):
+        (WebCore::ComplexLineLayout::determineEndPosition):
+        (WebCore::ComplexLineLayout::checkPaginationAndFloatsAtEndLine):
+        (WebCore::ComplexLineLayout::lineWidthForPaginatedLineChanged const):
+        (WebCore::ComplexLineLayout::matchedEndLine):
+        (WebCore::ComplexLineLayout::updateFragmentForLine const):
+        * rendering/RenderBlockFlow.cpp:
+        (WebCore::calculateMinimumPageHeight):
+        (WebCore::RenderBlockFlow::adjustLinePositionForPagination):
+        (WebCore::RenderBlockFlow::markLinesDirtyInBlockRange):
+        (WebCore::RenderBlockFlow::positionForPointWithInlineChildren):
+        * rendering/RenderBox.cpp:
+        (WebCore::RenderBox::positionLineBox):
+        * rendering/RenderLayoutState.cpp:
+        (WebCore::RenderLayoutState::computeLineGridPaginationOrigin):
+        * rendering/RenderLineBreak.cpp:
+        (WebCore::RenderLineBreak::collectSelectionRects):
+        * rendering/RenderText.cpp:
+        (WebCore::RenderText::collectSelectionRects):
+        * rendering/RootInlineBox.cpp:
+        (WebCore::RootInlineBox::adjustPosition):
+        (WebCore::RootInlineBox::alignBoxesInBlockDirection):
+        (WebCore::RootInlineBox::lineSnapAdjustment const):
+        (WebCore::RootInlineBox::outputLineBox const):
+        * rendering/RootInlineBox.h:
+        (WebCore::RootInlineBox::lineBoxTop const):
+        (WebCore::RootInlineBox::lineBoxBottom const):
+        (WebCore::RootInlineBox::setLineTopBottomPositions):
+        (WebCore::RootInlineBox::lineTopWithLeading const): Deleted.
+        (WebCore::RootInlineBox::lineBottomWithLeading const): Deleted.
+
+2020-10-29  Antti Koivisto  <[email protected]>
+
         [LFC][Integration] RenderBlockFlow::positionForPointWithInlineChildren should use iterator
         https://bugs.webkit.org/show_bug.cgi?id=218283
 

Modified: trunk/Source/WebCore/layout/integration/LayoutIntegrationLineIterator.h (269148 => 269149)


--- trunk/Source/WebCore/layout/integration/LayoutIntegrationLineIterator.h	2020-10-29 15:16:24 UTC (rev 269148)
+++ trunk/Source/WebCore/layout/integration/LayoutIntegrationLineIterator.h	2020-10-29 15:51:07 UTC (rev 269149)
@@ -55,8 +55,8 @@
     LayoutUnit selectionTop() const;
     LayoutUnit selectionTopForHitTesting() const;
     LayoutUnit selectionBottom() const;
-    LayoutUnit topWithLeading() const;
-    LayoutUnit bottomWithLeading() const;
+    LayoutUnit lineBoxTop() const;
+    LayoutUnit lineBoxBottom() const;
 
     float y() const;
     float logicalHeight() const;
@@ -156,17 +156,17 @@
     });
 }
 
-inline LayoutUnit PathLine::topWithLeading() const
+inline LayoutUnit PathLine::lineBoxTop() const
 {
     return WTF::switchOn(m_pathVariant, [](const auto& path) {
-        return path.topWithLeading();
+        return path.lineBoxTop();
     });
 }
 
-inline LayoutUnit PathLine::bottomWithLeading() const
+inline LayoutUnit PathLine::lineBoxBottom() const
 {
     return WTF::switchOn(m_pathVariant, [](const auto& path) {
-        return path.bottomWithLeading();
+        return path.lineBoxBottom();
     });
 }
 

Modified: trunk/Source/WebCore/layout/integration/LayoutIntegrationLineIteratorLegacyPath.h (269148 => 269149)


--- trunk/Source/WebCore/layout/integration/LayoutIntegrationLineIteratorLegacyPath.h	2020-10-29 15:16:24 UTC (rev 269148)
+++ trunk/Source/WebCore/layout/integration/LayoutIntegrationLineIteratorLegacyPath.h	2020-10-29 15:51:07 UTC (rev 269149)
@@ -49,8 +49,8 @@
     LayoutUnit selectionTop() const { return m_rootInlineBox->selectionTop(); }
     LayoutUnit selectionTopForHitTesting() const { return m_rootInlineBox->selectionTop(RootInlineBox::ForHitTesting::Yes); }
     LayoutUnit selectionBottom() const { return m_rootInlineBox->selectionBottom(); }
-    LayoutUnit topWithLeading() const { return m_rootInlineBox->lineTopWithLeading(); }
-    LayoutUnit bottomWithLeading() const { return m_rootInlineBox->lineBottomWithLeading(); }
+    LayoutUnit lineBoxTop() const { return m_rootInlineBox->lineBoxTop(); }
+    LayoutUnit lineBoxBottom() const { return m_rootInlineBox->lineBoxBottom(); }
 
     float y() const { return m_rootInlineBox->y(); }
     float logicalHeight() const { return m_rootInlineBox->logicalHeight(); }

Modified: trunk/Source/WebCore/layout/integration/LayoutIntegrationLineIteratorModernPath.h (269148 => 269149)


--- trunk/Source/WebCore/layout/integration/LayoutIntegrationLineIteratorModernPath.h	2020-10-29 15:16:24 UTC (rev 269148)
+++ trunk/Source/WebCore/layout/integration/LayoutIntegrationLineIteratorModernPath.h	2020-10-29 15:51:07 UTC (rev 269149)
@@ -55,8 +55,8 @@
     LayoutUnit selectionTop() const { return top(); }
     LayoutUnit selectionTopForHitTesting() const { return top(); }
     LayoutUnit selectionBottom() const { return bottom(); }
-    LayoutUnit topWithLeading() const { return top(); }
-    LayoutUnit bottomWithLeading() const { return bottom(); }
+    LayoutUnit lineBoxTop() const { return top(); }
+    LayoutUnit lineBoxBottom() const { return bottom(); }
 
     float y() const { return top(); }
     float logicalHeight() const { return line().rect().height(); }

Modified: trunk/Source/WebCore/rendering/ComplexLineLayout.cpp (269148 => 269149)


--- trunk/Source/WebCore/rendering/ComplexLineLayout.cpp	2020-10-29 15:16:24 UTC (rev 269148)
+++ trunk/Source/WebCore/rendering/ComplexLineLayout.cpp	2020-10-29 15:51:07 UTC (rev 269149)
@@ -1498,7 +1498,7 @@
                         continue;
                     }
 
-                    m_flow.setLogicalHeight(lineBox->lineBottomWithLeading());
+                    m_flow.setLogicalHeight(lineBox->lineBoxBottom());
                 }
                     
                 if (paginated) {
@@ -1597,7 +1597,7 @@
 
             // We now want to break at this line. Remember for next layout and trigger relayout.
             m_flow.setBreakAtLineToAvoidWidow(lineCountUntil(lineBox));
-            m_flow.markLinesDirtyInBlockRange(lastRootBox()->lineBottomWithLeading(), lineBox->lineBottomWithLeading(), lineBox);
+            m_flow.markLinesDirtyInBlockRange(lastRootBox()->lineBoxBottom(), lineBox->lineBoxBottom(), lineBox);
         }
     }
     m_flow.clearDidBreakAtLineToAvoidWidow();
@@ -1649,7 +1649,7 @@
                     updateFragmentForLine(line);
                 reattachCleanLineFloats(*line, delta, line == firstCleanLine);
             }
-            m_flow.setLogicalHeight(lastRootBox()->lineBottomWithLeading());
+            m_flow.setLogicalHeight(lastRootBox()->lineBoxBottom());
         } else {
             // Delete all the remaining lines.
             deleteLineRange(layoutState, layoutState.endLine());
@@ -1834,7 +1834,7 @@
         : std::max(originalFloatRect.width(), newSize.width());
     floatHeight = std::min(floatHeight, LayoutUnit::max() - floatTop);
     cleanLine.markDirty();
-    m_flow.markLinesDirtyInBlockRange(cleanLine.lineBottomWithLeading(), floatTop + floatHeight, &cleanLine);
+    m_flow.markLinesDirtyInBlockRange(cleanLine.lineBoxBottom(), floatTop + floatHeight, &cleanLine);
     LayoutRect newFloatRect = originalFloatRect;
     newFloatRect.setSize(newSize);
     matchingFloatWithRect.adjustRect(newFloatRect);
@@ -1961,7 +1961,7 @@
     layoutState.lineInfo().setPreviousLineBrokeCleanly(!lastLine || lastLine->endsWithBreak());
 
     if (lastLine) {
-        m_flow.setLogicalHeight(lastLine->lineBottomWithLeading());
+        m_flow.setLogicalHeight(lastLine->lineBoxBottom());
         InlineIterator iter = InlineIterator(&m_flow, lastLine->lineBreakObj(), lastLine->lineBreakPos());
         resolver.setPosition(iter, numberOfIsolateAncestors(iter));
         resolver.setStatus(lastLine->lineBreakBidiStatus());
@@ -2021,7 +2021,7 @@
     RootInlineBox* previousLine = lastLine->prevRootBox();
     cleanLineStart = InlineIterator(&m_flow, previousLine->lineBreakObj(), previousLine->lineBreakPos());
     cleanLineBidiStatus = previousLine->lineBreakBidiStatus();
-    layoutState.setEndLineLogicalTop(previousLine->lineBottomWithLeading());
+    layoutState.setEndLineLogicalTop(previousLine->lineBoxBottom());
 
     for (RootInlineBox* line = lastLine; line; line = line->nextRootBox()) {
         // Disconnect all line boxes from their render objects while preserving their connections to one another.
@@ -2063,7 +2063,7 @@
     while (RootInlineBox* nextLine = lastLine->nextRootBox())
         lastLine = nextLine;
 
-    LayoutUnit logicalBottom = lastLine->lineBottomWithLeading() + absoluteValue(lineDelta);
+    LayoutUnit logicalBottom = lastLine->lineBoxBottom() + absoluteValue(lineDelta);
 
     const FloatingObjectSet& floatingObjectSet = m_flow.floatingObjects()->set();
     auto end = floatingObjectSet.end();
@@ -2081,7 +2081,7 @@
     if (!fragmentedFlow)
         return false;
 
-    RenderFragmentContainer* currentFragment = m_flow.fragmentAtBlockOffset(rootBox->lineTopWithLeading() + lineDelta);
+    RenderFragmentContainer* currentFragment = m_flow.fragmentAtBlockOffset(rootBox->lineBoxTop() + lineDelta);
     // Just bail if the fragment didn't change.
     if (rootBox->containingFragment() == currentFragment)
         return false;
@@ -2111,7 +2111,7 @@
             RootInlineBox* result = line->nextRootBox();
             layoutState.setEndLine(result);
             if (result) {
-                layoutState.setEndLineLogicalTop(line->lineBottomWithLeading());
+                layoutState.setEndLineLogicalTop(line->lineBoxBottom());
                 matched = checkPaginationAndFloatsAtEndLine(layoutState);
             }
 
@@ -2299,7 +2299,7 @@
     if (!m_flow.hasFragmentRangeInFragmentedFlow())
         lineBox->clearContainingFragment();
     else {
-        if (auto containingFragment = m_flow.fragmentAtBlockOffset(lineBox->lineTopWithLeading()))
+        if (auto containingFragment = m_flow.fragmentAtBlockOffset(lineBox->lineBoxTop()))
             lineBox->setContainingFragment(*containingFragment);
         else
             lineBox->clearContainingFragment();

Modified: trunk/Source/WebCore/rendering/RenderBlockFlow.cpp (269148 => 269149)


--- trunk/Source/WebCore/rendering/RenderBlockFlow.cpp	2020-10-29 15:16:24 UTC (rev 269148)
+++ trunk/Source/WebCore/rendering/RenderBlockFlow.cpp	2020-10-29 15:51:07 UTC (rev 269149)
@@ -1693,7 +1693,7 @@
         // FIXME: Paginating using line overflow isn't all fine. See FIXME in
         // adjustLinePositionForPagination() for more details.
         LayoutRect overflow = line->logicalVisualOverflowRect(line->lineTop(), line->lineBottom());
-        lineTop = std::min(line->lineTopWithLeading(), overflow.y());
+        lineTop = std::min(line->lineBoxTop(), overflow.y());
     }
     return lineBottom - lineTop;
 }
@@ -1742,8 +1742,8 @@
     // line and all following lines.
     overflowsFragment = false;
     LayoutRect logicalVisualOverflow = lineBox->logicalVisualOverflowRect(lineBox->lineTop(), lineBox->lineBottom());
-    LayoutUnit logicalOffset = std::min(lineBox->lineTopWithLeading(), logicalVisualOverflow.y());
-    LayoutUnit logicalBottom = std::max(lineBox->lineBottomWithLeading(), logicalVisualOverflow.maxY());
+    LayoutUnit logicalOffset = std::min(lineBox->lineBoxTop(), logicalVisualOverflow.y());
+    LayoutUnit logicalBottom = std::max(lineBox->lineBoxBottom(), logicalVisualOverflow.maxY());
     LayoutUnit lineHeight = logicalBottom - logicalOffset;
     updateMinimumPageHeight(logicalOffset, calculateMinimumPageHeight(style(), *lineBox, logicalOffset, logicalBottom));
     logicalOffset += delta;
@@ -1792,7 +1792,7 @@
             return;
         if (lineHeight > pageLogicalHeight) {
             // Split the top margin in order to avoid splitting the visible part of the line.
-            remainingLogicalHeight -= std::min(lineHeight - pageLogicalHeight, std::max<LayoutUnit>(0, logicalVisualOverflow.y() - lineBox->lineTopWithLeading()));
+            remainingLogicalHeight -= std::min(lineHeight - pageLogicalHeight, std::max<LayoutUnit>(0, logicalVisualOverflow.y() - lineBox->lineBoxTop()));
         }
         LayoutUnit remainingLogicalHeightAtNewOffset = pageRemainingLogicalHeightForOffset(logicalOffset + remainingLogicalHeight, ExcludePageBoundary);
         overflowsFragment = (lineHeight > remainingLogicalHeightAtNewOffset);
@@ -3085,12 +3085,12 @@
 
     RootInlineBox* lowestDirtyLine = lastRootBox();
     RootInlineBox* afterLowest = lowestDirtyLine;
-    while (lowestDirtyLine && lowestDirtyLine->lineBottomWithLeading() >= logicalBottom && logicalBottom < LayoutUnit::max()) {
+    while (lowestDirtyLine && lowestDirtyLine->lineBoxBottom() >= logicalBottom && logicalBottom < LayoutUnit::max()) {
         afterLowest = lowestDirtyLine;
         lowestDirtyLine = lowestDirtyLine->prevRootBox();
     }
 
-    while (afterLowest && afterLowest != highest && (afterLowest->lineBottomWithLeading() >= logicalTop || afterLowest->lineBottomWithLeading() < 0)) {
+    while (afterLowest && afterLowest != highest && (afterLowest->lineBoxBottom() >= logicalTop || afterLowest->lineBoxBottom() < 0)) {
         afterLowest->markDirty();
         afterLowest = afterLowest->prevRootBox();
     }
@@ -3412,7 +3412,7 @@
             firstLineWithChildren = line;
 
         if (!linesAreFlipped && line->legacyRootInlineBox() && line->legacyRootInlineBox()->isFirstAfterPageBreak()
-            && (pointInLogicalContents.y() < line->topWithLeading() || (blocksAreFlipped && pointInLogicalContents.y() == line->topWithLeading())))
+            && (pointInLogicalContents.y() < line->lineBoxTop() || (blocksAreFlipped && pointInLogicalContents.y() == line->lineBoxTop())))
             break;
 
         lastLineWithChildren = line;
@@ -3425,7 +3425,7 @@
                     nextLineWithChildren.traverseNext();
 
                 if (nextLineWithChildren && nextLineWithChildren->legacyRootInlineBox() && nextLineWithChildren->legacyRootInlineBox()->isFirstAfterPageBreak()
-                    && (pointInLogicalContents.y() > nextLineWithChildren->topWithLeading() || (!blocksAreFlipped && pointInLogicalContents.y() == nextLineWithChildren->topWithLeading())))
+                    && (pointInLogicalContents.y() > nextLineWithChildren->lineBoxTop() || (!blocksAreFlipped && pointInLogicalContents.y() == nextLineWithChildren->lineBoxTop())))
                     continue;
             }
             closestRun = line.closestRunForLogicalLeftPosition(pointInLogicalContents.x());

Modified: trunk/Source/WebCore/rendering/RenderBox.cpp (269148 => 269149)


--- trunk/Source/WebCore/rendering/RenderBox.cpp	2020-10-29 15:16:24 UTC (rev 269148)
+++ trunk/Source/WebCore/rendering/RenderBox.cpp	2020-10-29 15:51:07 UTC (rev 269149)
@@ -2203,7 +2203,7 @@
             // our object was inline originally, since otherwise it would have ended up underneath
             // the inlines.
             RootInlineBox& rootBox = box.root();
-            rootBox.blockFlow().setStaticInlinePositionForChild(*this, rootBox.lineTopWithLeading(), LayoutUnit::fromFloatRound(box.logicalLeft()));
+            rootBox.blockFlow().setStaticInlinePositionForChild(*this, rootBox.lineBoxTop(), LayoutUnit::fromFloatRound(box.logicalLeft()));
             if (style().hasStaticInlinePosition(box.isHorizontal()))
                 setChildNeedsLayout(MarkOnlyThis); // Just mark the positioned object as needing layout, so it will update its position properly.
         } else {

Modified: trunk/Source/WebCore/rendering/RenderLayoutState.cpp (269148 => 269149)


--- trunk/Source/WebCore/rendering/RenderLayoutState.cpp	2020-10-29 15:16:24 UTC (rev 269148)
+++ trunk/Source/WebCore/rendering/RenderLayoutState.cpp	2020-10-29 15:51:07 UTC (rev 269149)
@@ -193,13 +193,13 @@
     // as established by the line box.
     // FIXME: Need to handle crazy line-box-contain values that cause the root line box to not be considered. I assume
     // the grid should honor line-box-contain.
-    LayoutUnit gridLineHeight = lineGridBox->lineBottomWithLeading() - lineGridBox->lineTopWithLeading();
+    LayoutUnit gridLineHeight = lineGridBox->lineBoxBottom() - lineGridBox->lineBoxTop();
     if (!gridLineHeight)
         return;
 
     bool isHorizontalWritingMode = m_lineGrid->isHorizontalWritingMode();
     LayoutUnit lineGridBlockOffset = isHorizontalWritingMode ? m_lineGridOffset.height() : m_lineGridOffset.width();
-    LayoutUnit firstLineTopWithLeading = lineGridBlockOffset + lineGridBox->lineTopWithLeading();
+    LayoutUnit firstLineTopWithLeading = lineGridBlockOffset + lineGridBox->lineBoxTop();
     LayoutUnit pageLogicalTop = isHorizontalWritingMode ? m_pageOffset.height() : m_pageOffset.width();
     if (pageLogicalTop <= firstLineTopWithLeading)
         return;

Modified: trunk/Source/WebCore/rendering/RenderLineBreak.cpp (269148 => 269149)


--- trunk/Source/WebCore/rendering/RenderLineBreak.cpp	2020-10-29 15:16:24 UTC (rev 269148)
+++ trunk/Source/WebCore/rendering/RenderLineBreak.cpp	2020-10-29 15:51:07 UTC (rev 269149)
@@ -212,9 +212,9 @@
     LayoutRect rect = rootBox.computeCaretRect(box->logicalLeft(), 0, nullptr);
     if (rootBox.isFirstAfterPageBreak()) {
         if (box->isHorizontal())
-            rect.shiftYEdgeTo(rootBox.lineTopWithLeading());
+            rect.shiftYEdgeTo(rootBox.lineBoxTop());
         else
-            rect.shiftXEdgeTo(rootBox.lineTopWithLeading());
+            rect.shiftXEdgeTo(rootBox.lineBoxTop());
     }
 
     auto* containingBlock = containingBlockForObjectInFlow();

Modified: trunk/Source/WebCore/rendering/RenderText.cpp (269148 => 269149)


--- trunk/Source/WebCore/rendering/RenderText.cpp	2020-10-29 15:16:24 UTC (rev 269148)
+++ trunk/Source/WebCore/rendering/RenderText.cpp	2020-10-29 15:51:07 UTC (rev 269149)
@@ -357,9 +357,9 @@
 
         if (box->root().isFirstAfterPageBreak()) {
             if (box->isHorizontal())
-                rect.shiftYEdgeTo(box->root().lineTopWithLeading());
+                rect.shiftYEdgeTo(box->root().lineBoxTop());
             else
-                rect.shiftXEdgeTo(box->root().lineTopWithLeading());
+                rect.shiftXEdgeTo(box->root().lineBoxTop());
         }
 
         RenderBlock* containingBlock = this->containingBlock();

Modified: trunk/Source/WebCore/rendering/RootInlineBox.cpp (269148 => 269149)


--- trunk/Source/WebCore/rendering/RootInlineBox.cpp	2020-10-29 15:16:24 UTC (rev 269148)
+++ trunk/Source/WebCore/rendering/RootInlineBox.cpp	2020-10-29 15:51:07 UTC (rev 269149)
@@ -186,8 +186,8 @@
     LayoutUnit blockDirectionDelta { isHorizontal() ? dy : dx }; // The block direction delta is a LayoutUnit.
     m_lineTop += blockDirectionDelta;
     m_lineBottom += blockDirectionDelta;
-    m_lineTopWithLeading += blockDirectionDelta;
-    m_lineBottomWithLeading += blockDirectionDelta;
+    m_lineBoxTop += blockDirectionDelta;
+    m_lineBoxBottom += blockDirectionDelta;
     if (hasEllipsisBox())
         ellipsisBox()->adjustPosition(dx, dy);
 }
@@ -276,9 +276,9 @@
     
     maxHeight = std::max<LayoutUnit>(0, maxHeight); // FIXME: Is this really necessary?
 
-    LayoutUnit lineTopWithLeading = heightOfBlock;
-    LayoutUnit lineBottomWithLeading = heightOfBlock + maxHeight;
-    setLineTopBottomPositions(lineTop, lineBottom, lineTopWithLeading, lineBottomWithLeading);
+    LayoutUnit lineBoxTop = heightOfBlock;
+    LayoutUnit lineBoxBottom = heightOfBlock + maxHeight;
+    setLineTopBottomPositions(lineTop, lineBottom, lineBoxTop, lineBoxBottom);
     setPaginatedLineWidth(blockFlow().availableLogicalWidthForContent(heightOfBlock));
 
     LayoutUnit annotationsAdjustment = beforeAnnotationsAdjustment();
@@ -355,7 +355,7 @@
     // as established by the line box.
     // FIXME: Need to handle crazy line-box-contain values that cause the root line box to not be considered. I assume
     // the grid should honor line-box-contain.
-    LayoutUnit gridLineHeight = lineGridBox->lineBottomWithLeading() - lineGridBox->lineTopWithLeading();
+    LayoutUnit gridLineHeight = lineGridBox->lineBoxBottom() - lineGridBox->lineBoxTop();
     if (!gridLineHeight)
         return 0;
 
@@ -362,7 +362,7 @@
     LayoutUnit lineGridFontAscent = lineGrid->style().fontMetrics().ascent(baselineType());
     LayoutUnit lineGridFontHeight { lineGridBox->logicalHeight() };
     LayoutUnit firstTextTop { lineGridBlockOffset + lineGridBox->logicalTop() };
-    LayoutUnit firstLineTopWithLeading = lineGridBlockOffset + lineGridBox->lineTopWithLeading();
+    LayoutUnit firstLineTopWithLeading = lineGridBlockOffset + lineGridBox->lineBoxTop();
     LayoutUnit firstBaselinePosition = firstTextTop + lineGridFontAscent;
 
     LayoutUnit currentTextTop { blockOffset + logicalTop() + delta };
@@ -375,7 +375,7 @@
     // FIXME: If the grid is an ancestor of the pagination establisher, then this is incorrect.
     LayoutUnit pageLogicalTop;
     if (layoutState->isPaginated() && layoutState->pageLogicalHeight()) {
-        pageLogicalTop = blockFlow().pageLogicalTopForOffset(lineTopWithLeading() + delta);
+        pageLogicalTop = blockFlow().pageLogicalTopForOffset(lineBoxTop() + delta);
         if (pageLogicalTop > firstLineTopWithLeading)
             firstTextTop = pageLogicalTop + lineGridBox->logicalTop() - lineGrid->borderAndPaddingBefore() + lineGridPaginationOrigin;
     }
@@ -412,12 +412,12 @@
         return result;
     
     // We may end up shifted to a new page. We need to do a re-snap when that happens.
-    LayoutUnit newPageLogicalTop = blockFlow().pageLogicalTopForOffset(lineBottomWithLeading() + result);
+    LayoutUnit newPageLogicalTop = blockFlow().pageLogicalTopForOffset(lineBoxBottom() + result);
     if (newPageLogicalTop == pageLogicalTop)
         return result;
     
     // Put ourselves at the top of the next page to force a snap onto the new grid established by that page.
-    return lineSnapAdjustment(newPageLogicalTop - (blockOffset + lineTopWithLeading()));
+    return lineSnapAdjustment(newPageLogicalTop - (blockOffset + lineBoxTop()));
 }
 
 GapRects RootInlineBox::lineSelectionGap(RenderBlock& rootBlock, const LayoutPoint& rootBlockPhysicalPosition, const LayoutSize& offsetFromRootBlock,
@@ -1112,7 +1112,7 @@
     int printedCharacters = 0;
     while (++printedCharacters <= depth * 2)
         stream << " ";
-    stream << "Line: (top: " << lineTop() << " bottom: " << lineBottom() << ") with leading (top: " << lineTopWithLeading() << " bottom: " << lineBottomWithLeading() << ")";
+    stream << "Line: (top: " << lineTop() << " bottom: " << lineBottom() << ") with leading (top: " << lineBoxTop() << " bottom: " << lineBoxBottom() << ")";
     stream.nextLine();
     InlineBox::outputLineBox(stream, mark, depth);
 }

Modified: trunk/Source/WebCore/rendering/RootInlineBox.h (269148 => 269149)


--- trunk/Source/WebCore/rendering/RootInlineBox.h	2020-10-29 15:16:24 UTC (rev 269148)
+++ trunk/Source/WebCore/rendering/RootInlineBox.h	2020-10-29 15:51:07 UTC (rev 269149)
@@ -54,8 +54,8 @@
     LayoutUnit lineTop() const { return m_lineTop; }
     LayoutUnit lineBottom() const { return m_lineBottom; }
 
-    LayoutUnit lineTopWithLeading() const { return m_lineTopWithLeading; }
-    LayoutUnit lineBottomWithLeading() const { return m_lineBottomWithLeading; }
+    LayoutUnit lineBoxTop() const { return m_lineBoxTop; }
+    LayoutUnit lineBoxBottom() const { return m_lineBoxBottom; }
     
     LayoutUnit paginationStrut() const { return m_paginationStrut; }
     void setPaginationStrut(LayoutUnit strut) { m_paginationStrut = strut; }
@@ -81,12 +81,12 @@
     LayoutUnit selectionHeightAdjustedForPrecedingBlock() const { return std::max<LayoutUnit>(0, selectionBottom() - selectionTopAdjustedForPrecedingBlock()); }
 
     LayoutUnit alignBoxesInBlockDirection(LayoutUnit heightOfBlock, GlyphOverflowAndFallbackFontsMap&, VerticalPositionCache&);
-    void setLineTopBottomPositions(LayoutUnit top, LayoutUnit bottom, LayoutUnit topWithLeading, LayoutUnit bottomWithLeading)
+    void setLineTopBottomPositions(LayoutUnit top, LayoutUnit bottom, LayoutUnit lineBoxTop, LayoutUnit lineBoxBottom)
     { 
         m_lineTop = top; 
         m_lineBottom = bottom;
-        m_lineTopWithLeading = topWithLeading;
-        m_lineBottomWithLeading = bottomWithLeading;
+        m_lineBoxTop = lineBoxTop;
+        m_lineBoxBottom = lineBoxBottom;
     }
 
     RenderObject* lineBreakObj() const { return m_lineBreakObj.get(); }
@@ -216,8 +216,8 @@
     LayoutUnit m_lineTop;
     LayoutUnit m_lineBottom;
 
-    LayoutUnit m_lineTopWithLeading;
-    LayoutUnit m_lineBottomWithLeading;
+    LayoutUnit m_lineBoxTop;
+    LayoutUnit m_lineBoxBottom;
 
     LayoutUnit m_paginationStrut;
     LayoutUnit m_paginatedLineWidth;
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to