Diff
Modified: trunk/Source/WebCore/ChangeLog (250340 => 250341)
--- trunk/Source/WebCore/ChangeLog 2019-09-25 10:11:06 UTC (rev 250340)
+++ trunk/Source/WebCore/ChangeLog 2019-09-25 14:23:03 UTC (rev 250341)
@@ -1,3 +1,99 @@
+2019-09-25 Antti Koivisto <[email protected]>
+
+ Rename InlineBox::nextLeafChild to nextLeafOnLine
+ https://bugs.webkit.org/show_bug.cgi?id=202197
+
+ Reviewed by Zalan Bujtas.
+
+ The name is confusing as it never returns a child of the inline box it is called on.
+ Rename it and other similar functions that traverse within a line.
+
+ * dom/Position.cpp:
+ (WebCore::Position::getInlineBoxAndOffset const):
+ * editing/RenderedPosition.cpp:
+ (WebCore::RenderedPosition::RenderedPosition):
+ (WebCore::RenderedPosition::previousLeafOnLine const):
+ (WebCore::RenderedPosition::nextLeafOnLine const):
+ (WebCore::RenderedPosition::isEquivalent const):
+ (WebCore::RenderedPosition::bidiLevelOnLeft const):
+ (WebCore::RenderedPosition::bidiLevelOnRight const):
+ (WebCore::RenderedPosition::leftBoundaryOfBidiRun):
+ (WebCore::RenderedPosition::rightBoundaryOfBidiRun):
+ (WebCore::RenderedPosition::atLeftBoundaryOfBidiRun const):
+ (WebCore::RenderedPosition::atRightBoundaryOfBidiRun const):
+ (WebCore::RenderedPosition::positionAtLeftBoundaryOfBiDiRun const):
+ (WebCore::RenderedPosition::positionAtRightBoundaryOfBiDiRun const):
+ (WebCore::RenderedPosition::prevLeafChild const): Deleted.
+ (WebCore::RenderedPosition::nextLeafChild const): Deleted.
+ * editing/RenderedPosition.h:
+ (WebCore::RenderedPosition::RenderedPosition):
+ * editing/VisiblePosition.cpp:
+ (WebCore::VisiblePosition::leftVisuallyDistinctCandidate const):
+ (WebCore::VisiblePosition::rightVisuallyDistinctCandidate const):
+ * editing/VisibleUnits.cpp:
+ (WebCore::startPositionForLine):
+ (WebCore::endPositionForLine):
+ (WebCore::previousLinePosition):
+ (WebCore::nextLinePosition):
+ * layout/Verification.cpp:
+ (WebCore::Layout::collectFlowBoxSubtree):
+ * rendering/ComplexLineLayout.cpp:
+ (WebCore::ComplexLineLayout::updateRubyForJustifiedText):
+ (WebCore::expansionBehaviorForInlineTextBox):
+ (WebCore::ComplexLineLayout::computeInlineDirectionPositionsForSegment):
+ (WebCore::ComplexLineLayout::layoutRunsAndFloats):
+ * rendering/InlineBox.cpp:
+ (WebCore::InlineBox::previousOnLineExists const):
+ (WebCore::InlineBox::nextLeafOnLine const):
+ (WebCore::InlineBox::previousLeafOnLine const):
+ (WebCore::InlineBox::nextLeafOnLineIgnoringLineBreak const):
+ (WebCore::InlineBox::previousLeafOnLineIgnoringLineBreak const):
+ (WebCore::InlineBox::nextLeafChild const): Deleted.
+ (WebCore::InlineBox::prevLeafChild const): Deleted.
+ (WebCore::InlineBox::nextLeafChildIgnoringLineBreak const): Deleted.
+ (WebCore::InlineBox::prevLeafChildIgnoringLineBreak const): Deleted.
+ * rendering/InlineBox.h:
+ (WebCore::InlineBox::nextOnLine const):
+ (WebCore::InlineBox::previousOnLine const):
+ (WebCore::InlineBox::setNextOnLine):
+ (WebCore::InlineBox::setPreviousOnLine):
+ (WebCore::InlineBox::InlineBox):
+ (WebCore::InlineBox::prevOnLine const): Deleted.
+ (WebCore::InlineBox::setPrevOnLine): Deleted.
+ * rendering/InlineFlowBox.cpp:
+ (WebCore::InlineFlowBox::addToLine):
+ (WebCore::InlineFlowBox::removeChild):
+ (WebCore::InlineFlowBox::nodeAtPoint):
+ (WebCore::InlineFlowBox::firstLeafDescendant const):
+ (WebCore::InlineFlowBox::lastLeafDescendant const):
+ (WebCore::InlineFlowBox::placeEllipsisBox):
+ (WebCore::InlineFlowBox::collectLeafBoxesInLogicalOrder const):
+ (WebCore::InlineFlowBox::checkConsistency const):
+ (WebCore::InlineFlowBox::firstLeafChild const): Deleted.
+ (WebCore::InlineFlowBox::lastLeafChild const): Deleted.
+ * rendering/InlineFlowBox.h:
+ * rendering/InlineTextBox.cpp:
+ (WebCore::InlineTextBox::expansionBehavior const):
+ * rendering/RenderBlockFlow.cpp:
+ (WebCore::RenderBlockFlow::containsNonZeroBidiLevel const):
+ (WebCore::RenderBlockFlow::positionForPointWithInlineChildren):
+ * rendering/RenderCounter.cpp:
+ (WebCore::RenderCounter::rendererRemovedFromTree):
+ * rendering/RenderTextLineBoxes.cpp:
+ (WebCore::lineDirectionPointFitsInBox):
+ (WebCore::createVisiblePositionAfterAdjustingOffsetForBiDi):
+ (WebCore::RenderTextLineBoxes::positionForPoint const):
+ * rendering/RootInlineBox.cpp:
+ (WebCore::RootInlineBox::isHyphenated const):
+ (WebCore::RootInlineBox::lineSelectionGap):
+ (WebCore::RootInlineBox::selectionState):
+ (WebCore::RootInlineBox::firstSelectedBox):
+ (WebCore::RootInlineBox::lastSelectedBox):
+ (WebCore::RootInlineBox::closestLeafChildForLogicalLeftPosition):
+ * rendering/svg/SVGRootInlineBox.cpp:
+ (WebCore::SVGRootInlineBox::closestLeafChildForPosition):
+ (WebCore::SVGRootInlineBox::nodeAtPoint):
+
2019-09-25 Zan Dobersek <[email protected]>
[Nicosia] Add implementations for fixed, positioned, sticky ScrollingTreeNodes
Modified: trunk/Source/WebCore/dom/Position.cpp (250340 => 250341)
--- trunk/Source/WebCore/dom/Position.cpp 2019-09-25 10:11:06 UTC (rev 250340)
+++ trunk/Source/WebCore/dom/Position.cpp 2019-09-25 14:23:03 UTC (rev 250341)
@@ -1244,7 +1244,7 @@
if (((caretOffset == caretMaxOffset) ^ (affinity == DOWNSTREAM))
|| ((caretOffset == caretMinOffset) ^ (affinity == UPSTREAM))
- || (caretOffset == caretMaxOffset && box->nextLeafChild() && box->nextLeafChild()->isLineBreak()))
+ || (caretOffset == caretMaxOffset && box->nextLeafOnLine() && box->nextLeafOnLine()->isLineBreak()))
break;
candidate = box;
@@ -1285,7 +1285,7 @@
if (inlineBox->direction() == primaryDirection) {
if (caretOffset == inlineBox->caretRightmostOffset()) {
- InlineBox* nextBox = inlineBox->nextLeafChild();
+ InlineBox* nextBox = inlineBox->nextLeafOnLine();
if (!nextBox || nextBox->bidiLevel() >= level)
return;
@@ -1292,7 +1292,7 @@
level = nextBox->bidiLevel();
InlineBox* prevBox = inlineBox;
do {
- prevBox = prevBox->prevLeafChild();
+ prevBox = prevBox->previousLeafOnLine();
} while (prevBox && prevBox->bidiLevel() > level);
if (prevBox && prevBox->bidiLevel() == level) // For example, abc FED 123 ^ CBA
@@ -1299,7 +1299,7 @@
return;
// For example, abc 123 ^ CBA
- while (InlineBox* nextBox = inlineBox->nextLeafChild()) {
+ while (InlineBox* nextBox = inlineBox->nextLeafOnLine()) {
if (nextBox->bidiLevel() < level)
break;
inlineBox = nextBox;
@@ -1306,7 +1306,7 @@
}
caretOffset = inlineBox->caretRightmostOffset();
} else {
- InlineBox* prevBox = inlineBox->prevLeafChild();
+ InlineBox* prevBox = inlineBox->previousLeafOnLine();
if (!prevBox || prevBox->bidiLevel() >= level)
return;
@@ -1313,13 +1313,13 @@
level = prevBox->bidiLevel();
InlineBox* nextBox = inlineBox;
do {
- nextBox = nextBox->nextLeafChild();
+ nextBox = nextBox->nextLeafOnLine();
} while (nextBox && nextBox->bidiLevel() > level);
if (nextBox && nextBox->bidiLevel() == level)
return;
- while (InlineBox* prevBox = inlineBox->prevLeafChild()) {
+ while (InlineBox* prevBox = inlineBox->previousLeafOnLine()) {
if (prevBox->bidiLevel() < level)
break;
inlineBox = prevBox;
@@ -1330,10 +1330,10 @@
}
if (caretOffset == inlineBox->caretLeftmostOffset()) {
- InlineBox* prevBox = inlineBox->prevLeafChildIgnoringLineBreak();
+ InlineBox* prevBox = inlineBox->previousLeafOnLineIgnoringLineBreak();
if (!prevBox || prevBox->bidiLevel() < level) {
// Left edge of a secondary run. Set to the right edge of the entire run.
- while (InlineBox* nextBox = inlineBox->nextLeafChildIgnoringLineBreak()) {
+ while (InlineBox* nextBox = inlineBox->nextLeafOnLineIgnoringLineBreak()) {
if (nextBox->bidiLevel() < level)
break;
inlineBox = nextBox;
@@ -1341,7 +1341,7 @@
caretOffset = inlineBox->caretRightmostOffset();
} else if (prevBox->bidiLevel() > level) {
// Right edge of a "tertiary" run. Set to the left edge of that run.
- while (InlineBox* tertiaryBox = inlineBox->prevLeafChildIgnoringLineBreak()) {
+ while (InlineBox* tertiaryBox = inlineBox->previousLeafOnLineIgnoringLineBreak()) {
if (tertiaryBox->bidiLevel() <= level)
break;
inlineBox = tertiaryBox;
@@ -1349,10 +1349,10 @@
caretOffset = inlineBox->caretLeftmostOffset();
}
} else {
- InlineBox* nextBox = inlineBox->nextLeafChildIgnoringLineBreak();
+ InlineBox* nextBox = inlineBox->nextLeafOnLineIgnoringLineBreak();
if (!nextBox || nextBox->bidiLevel() < level) {
// Right edge of a secondary run. Set to the left edge of the entire run.
- while (InlineBox* prevBox = inlineBox->prevLeafChildIgnoringLineBreak()) {
+ while (InlineBox* prevBox = inlineBox->previousLeafOnLineIgnoringLineBreak()) {
if (prevBox->bidiLevel() < level)
break;
inlineBox = prevBox;
@@ -1360,7 +1360,7 @@
caretOffset = inlineBox->caretLeftmostOffset();
} else if (nextBox->bidiLevel() > level) {
// Left edge of a "tertiary" run. Set to the right edge of that run.
- while (InlineBox* tertiaryBox = inlineBox->nextLeafChildIgnoringLineBreak()) {
+ while (InlineBox* tertiaryBox = inlineBox->nextLeafOnLineIgnoringLineBreak()) {
if (tertiaryBox->bidiLevel() <= level)
break;
inlineBox = tertiaryBox;
Modified: trunk/Source/WebCore/editing/RenderedPosition.cpp (250340 => 250341)
--- trunk/Source/WebCore/editing/RenderedPosition.cpp 2019-09-25 10:11:06 UTC (rev 250340)
+++ trunk/Source/WebCore/editing/RenderedPosition.cpp 2019-09-25 14:23:03 UTC (rev 250341)
@@ -65,8 +65,8 @@
RenderedPosition::RenderedPosition(const VisiblePosition& position)
: m_offset(0)
- , m_prevLeafChild(uncachedInlineBox())
- , m_nextLeafChild(uncachedInlineBox())
+ , m_previousLeafOnLine(uncachedInlineBox())
+ , m_nextLeafOnLine(uncachedInlineBox())
{
if (position.isNull())
return;
@@ -79,8 +79,8 @@
RenderedPosition::RenderedPosition(const Position& position, EAffinity affinity)
: m_offset(0)
- , m_prevLeafChild(uncachedInlineBox())
- , m_nextLeafChild(uncachedInlineBox())
+ , m_previousLeafOnLine(uncachedInlineBox())
+ , m_nextLeafOnLine(uncachedInlineBox())
{
if (position.isNull())
return;
@@ -91,36 +91,36 @@
m_renderer = rendererFromPosition(position);
}
-InlineBox* RenderedPosition::prevLeafChild() const
+InlineBox* RenderedPosition::previousLeafOnLine() const
{
- if (m_prevLeafChild == uncachedInlineBox())
- m_prevLeafChild = m_inlineBox->prevLeafChildIgnoringLineBreak();
- return m_prevLeafChild;
+ if (m_previousLeafOnLine == uncachedInlineBox())
+ m_previousLeafOnLine = m_inlineBox->previousLeafOnLineIgnoringLineBreak();
+ return m_previousLeafOnLine;
}
-InlineBox* RenderedPosition::nextLeafChild() const
+InlineBox* RenderedPosition::nextLeafOnLine() const
{
- if (m_nextLeafChild == uncachedInlineBox())
- m_nextLeafChild = m_inlineBox->nextLeafChildIgnoringLineBreak();
- return m_nextLeafChild;
+ if (m_nextLeafOnLine == uncachedInlineBox())
+ m_nextLeafOnLine = m_inlineBox->nextLeafOnLineIgnoringLineBreak();
+ return m_nextLeafOnLine;
}
bool RenderedPosition::isEquivalent(const RenderedPosition& other) const
{
return (m_renderer == other.m_renderer && m_inlineBox == other.m_inlineBox && m_offset == other.m_offset)
- || (atLeftmostOffsetInBox() && other.atRightmostOffsetInBox() && prevLeafChild() == other.m_inlineBox)
- || (atRightmostOffsetInBox() && other.atLeftmostOffsetInBox() && nextLeafChild() == other.m_inlineBox);
+ || (atLeftmostOffsetInBox() && other.atRightmostOffsetInBox() && previousLeafOnLine() == other.m_inlineBox)
+ || (atRightmostOffsetInBox() && other.atLeftmostOffsetInBox() && nextLeafOnLine() == other.m_inlineBox);
}
unsigned char RenderedPosition::bidiLevelOnLeft() const
{
- InlineBox* box = atLeftmostOffsetInBox() ? prevLeafChild() : m_inlineBox;
+ InlineBox* box = atLeftmostOffsetInBox() ? previousLeafOnLine() : m_inlineBox;
return box ? box->bidiLevel() : 0;
}
unsigned char RenderedPosition::bidiLevelOnRight() const
{
- InlineBox* box = atRightmostOffsetInBox() ? nextLeafChild() : m_inlineBox;
+ InlineBox* box = atRightmostOffsetInBox() ? nextLeafOnLine() : m_inlineBox;
return box ? box->bidiLevel() : 0;
}
@@ -131,7 +131,7 @@
InlineBox* box = m_inlineBox;
do {
- InlineBox* prev = box->prevLeafChildIgnoringLineBreak();
+ InlineBox* prev = box->previousLeafOnLineIgnoringLineBreak();
if (!prev || prev->bidiLevel() < bidiLevelOfRun)
return RenderedPosition(&box->renderer(), box, box->caretLeftmostOffset());
box = prev;
@@ -148,7 +148,7 @@
InlineBox* box = m_inlineBox;
do {
- InlineBox* next = box->nextLeafChildIgnoringLineBreak();
+ InlineBox* next = box->nextLeafOnLineIgnoringLineBreak();
if (!next || next->bidiLevel() < bidiLevelOfRun)
return RenderedPosition(&box->renderer(), box, box->caretRightmostOffset());
box = next;
@@ -165,14 +165,14 @@
if (atLeftmostOffsetInBox()) {
if (shouldMatchBidiLevel == IgnoreBidiLevel)
- return !prevLeafChild() || prevLeafChild()->bidiLevel() < m_inlineBox->bidiLevel();
- return m_inlineBox->bidiLevel() >= bidiLevelOfRun && (!prevLeafChild() || prevLeafChild()->bidiLevel() < bidiLevelOfRun);
+ return !previousLeafOnLine() || previousLeafOnLine()->bidiLevel() < m_inlineBox->bidiLevel();
+ return m_inlineBox->bidiLevel() >= bidiLevelOfRun && (!previousLeafOnLine() || previousLeafOnLine()->bidiLevel() < bidiLevelOfRun);
}
if (atRightmostOffsetInBox()) {
if (shouldMatchBidiLevel == IgnoreBidiLevel)
- return nextLeafChild() && m_inlineBox->bidiLevel() < nextLeafChild()->bidiLevel();
- return nextLeafChild() && m_inlineBox->bidiLevel() < bidiLevelOfRun && nextLeafChild()->bidiLevel() >= bidiLevelOfRun;
+ return nextLeafOnLine() && m_inlineBox->bidiLevel() < nextLeafOnLine()->bidiLevel();
+ return nextLeafOnLine() && m_inlineBox->bidiLevel() < bidiLevelOfRun && nextLeafOnLine()->bidiLevel() >= bidiLevelOfRun;
}
return false;
@@ -185,14 +185,14 @@
if (atRightmostOffsetInBox()) {
if (shouldMatchBidiLevel == IgnoreBidiLevel)
- return !nextLeafChild() || nextLeafChild()->bidiLevel() < m_inlineBox->bidiLevel();
- return m_inlineBox->bidiLevel() >= bidiLevelOfRun && (!nextLeafChild() || nextLeafChild()->bidiLevel() < bidiLevelOfRun);
+ return !nextLeafOnLine() || nextLeafOnLine()->bidiLevel() < m_inlineBox->bidiLevel();
+ return m_inlineBox->bidiLevel() >= bidiLevelOfRun && (!nextLeafOnLine() || nextLeafOnLine()->bidiLevel() < bidiLevelOfRun);
}
if (atLeftmostOffsetInBox()) {
if (shouldMatchBidiLevel == IgnoreBidiLevel)
- return prevLeafChild() && m_inlineBox->bidiLevel() < prevLeafChild()->bidiLevel();
- return prevLeafChild() && m_inlineBox->bidiLevel() < bidiLevelOfRun && prevLeafChild()->bidiLevel() >= bidiLevelOfRun;
+ return previousLeafOnLine() && m_inlineBox->bidiLevel() < previousLeafOnLine()->bidiLevel();
+ return previousLeafOnLine() && m_inlineBox->bidiLevel() < bidiLevelOfRun && previousLeafOnLine()->bidiLevel() >= bidiLevelOfRun;
}
return false;
@@ -205,7 +205,7 @@
if (atLeftmostOffsetInBox())
return createLegacyEditingPosition(m_renderer->node(), m_offset);
- return createLegacyEditingPosition(nextLeafChild()->renderer().node(), nextLeafChild()->caretLeftmostOffset());
+ return createLegacyEditingPosition(nextLeafOnLine()->renderer().node(), nextLeafOnLine()->caretLeftmostOffset());
}
Position RenderedPosition::positionAtRightBoundaryOfBiDiRun() const
@@ -215,7 +215,7 @@
if (atRightmostOffsetInBox())
return createLegacyEditingPosition(m_renderer->node(), m_offset);
- return createLegacyEditingPosition(prevLeafChild()->renderer().node(), prevLeafChild()->caretRightmostOffset());
+ return createLegacyEditingPosition(previousLeafOnLine()->renderer().node(), previousLeafOnLine()->caretRightmostOffset());
}
IntRect RenderedPosition::absoluteRect(LayoutUnit* extraWidthToEndOfLine) const
Modified: trunk/Source/WebCore/editing/RenderedPosition.h (250340 => 250341)
--- trunk/Source/WebCore/editing/RenderedPosition.h 2019-09-25 10:11:06 UTC (rev 250340)
+++ trunk/Source/WebCore/editing/RenderedPosition.h 2019-09-25 14:23:03 UTC (rev 250341)
@@ -72,8 +72,8 @@
bool operator==(const RenderedPosition&) const { return false; }
explicit RenderedPosition(RenderObject*, InlineBox*, int offset);
- InlineBox* prevLeafChild() const;
- InlineBox* nextLeafChild() const;
+ InlineBox* previousLeafOnLine() const;
+ InlineBox* nextLeafOnLine() const;
bool atLeftmostOffsetInBox() const { return m_inlineBox && m_offset == m_inlineBox->caretLeftmostOffset(); }
bool atRightmostOffsetInBox() const { return m_inlineBox && m_offset == m_inlineBox->caretRightmostOffset(); }
bool atLeftBoundaryOfBidiRun(ShouldMatchBidiLevel, unsigned char bidiLevelOfRun) const;
@@ -86,14 +86,14 @@
static InlineBox* uncachedInlineBox() { return reinterpret_cast<InlineBox*>(1); }
// Needs to be different form 0 so pick 1 because it's also on the null page.
- mutable InlineBox* m_prevLeafChild;
- mutable InlineBox* m_nextLeafChild;
+ mutable InlineBox* m_previousLeafOnLine;
+ mutable InlineBox* m_nextLeafOnLine;
};
inline RenderedPosition::RenderedPosition()
: m_offset(0)
- , m_prevLeafChild(uncachedInlineBox())
- , m_nextLeafChild(uncachedInlineBox())
+ , m_previousLeafOnLine(uncachedInlineBox())
+ , m_nextLeafOnLine(uncachedInlineBox())
{
}
@@ -101,8 +101,8 @@
: m_renderer(renderer)
, m_inlineBox(box)
, m_offset(offset)
- , m_prevLeafChild(uncachedInlineBox())
- , m_nextLeafChild(uncachedInlineBox())
+ , m_previousLeafOnLine(uncachedInlineBox())
+ , m_nextLeafOnLine(uncachedInlineBox())
{
}
Modified: trunk/Source/WebCore/editing/VisiblePosition.cpp (250340 => 250341)
--- trunk/Source/WebCore/editing/VisiblePosition.cpp 2019-09-25 10:11:06 UTC (rev 250340)
+++ trunk/Source/WebCore/editing/VisiblePosition.cpp 2019-09-25 14:23:03 UTC (rev 250341)
@@ -136,7 +136,7 @@
return box->isLeftToRightDirection() ? previousVisuallyDistinctCandidate(m_deepPosition) : nextVisuallyDistinctCandidate(m_deepPosition);
if (!renderer->node()) {
- box = box->prevLeafChild();
+ box = box->previousLeafOnLine();
if (!box)
return primaryDirection == TextDirection::LTR ? previousVisuallyDistinctCandidate(m_deepPosition) : nextVisuallyDistinctCandidate(m_deepPosition);
renderer = &box->renderer();
@@ -154,7 +154,7 @@
if (box->isLeftToRightDirection() ? offset < caretMinOffset : offset > caretMaxOffset) {
// Overshot to the left.
- InlineBox* prevBox = box->prevLeafChildIgnoringLineBreak();
+ InlineBox* prevBox = box->previousLeafOnLineIgnoringLineBreak();
if (!prevBox) {
Position positionOnLeft = primaryDirection == TextDirection::LTR ? previousVisuallyDistinctCandidate(m_deepPosition) : nextVisuallyDistinctCandidate(m_deepPosition);
if (positionOnLeft.isNull())
@@ -178,7 +178,7 @@
ASSERT(offset == box->caretLeftmostOffset());
unsigned char level = box->bidiLevel();
- InlineBox* prevBox = box->prevLeafChild();
+ InlineBox* prevBox = box->previousLeafOnLine();
if (box->direction() == primaryDirection) {
if (!prevBox) {
@@ -197,7 +197,7 @@
InlineBox* nextBox = box;
do {
- nextBox = nextBox->nextLeafChild();
+ nextBox = nextBox->nextLeafOnLine();
} while (nextBox && nextBox->bidiLevel() > level);
if (nextBox && nextBox->bidiLevel() == level)
@@ -212,7 +212,7 @@
}
while (prevBox && !prevBox->renderer().node())
- prevBox = prevBox->prevLeafChild();
+ prevBox = prevBox->previousLeafOnLine();
if (prevBox) {
box = prevBox;
@@ -220,7 +220,7 @@
offset = box->caretRightmostOffset();
if (box->bidiLevel() > level) {
do {
- prevBox = prevBox->prevLeafChild();
+ prevBox = prevBox->previousLeafOnLine();
} while (prevBox && prevBox->bidiLevel() > level);
if (!prevBox || prevBox->bidiLevel() < level)
@@ -229,7 +229,7 @@
} else {
// Trailing edge of a secondary run. Set to the leading edge of the entire run.
while (true) {
- while (InlineBox* nextBox = box->nextLeafChild()) {
+ while (InlineBox* nextBox = box->nextLeafOnLine()) {
if (nextBox->bidiLevel() < level)
break;
box = nextBox;
@@ -237,7 +237,7 @@
if (box->bidiLevel() == level)
break;
level = box->bidiLevel();
- while (InlineBox* prevBox = box->prevLeafChild()) {
+ while (InlineBox* prevBox = box->previousLeafOnLine()) {
if (prevBox->bidiLevel() < level)
break;
box = prevBox;
@@ -306,7 +306,7 @@
return box->isLeftToRightDirection() ? nextVisuallyDistinctCandidate(m_deepPosition) : previousVisuallyDistinctCandidate(m_deepPosition);
if (!renderer->node()) {
- box = box->nextLeafChild();
+ box = box->nextLeafOnLine();
if (!box)
return primaryDirection == TextDirection::LTR ? nextVisuallyDistinctCandidate(m_deepPosition) : previousVisuallyDistinctCandidate(m_deepPosition);
renderer = &box->renderer();
@@ -324,7 +324,7 @@
if (box->isLeftToRightDirection() ? offset > caretMaxOffset : offset < caretMinOffset) {
// Overshot to the right.
- InlineBox* nextBox = box->nextLeafChildIgnoringLineBreak();
+ InlineBox* nextBox = box->nextLeafOnLineIgnoringLineBreak();
if (!nextBox) {
Position positionOnRight = primaryDirection == TextDirection::LTR ? nextVisuallyDistinctCandidate(m_deepPosition) : previousVisuallyDistinctCandidate(m_deepPosition);
if (positionOnRight.isNull())
@@ -348,7 +348,7 @@
ASSERT(offset == box->caretRightmostOffset());
unsigned char level = box->bidiLevel();
- InlineBox* nextBox = box->nextLeafChild();
+ InlineBox* nextBox = box->nextLeafOnLine();
if (box->direction() == primaryDirection) {
if (!nextBox) {
@@ -368,7 +368,7 @@
InlineBox* prevBox = box;
do {
- prevBox = prevBox->prevLeafChild();
+ prevBox = prevBox->previousLeafOnLine();
} while (prevBox && prevBox->bidiLevel() > level);
if (prevBox && prevBox->bidiLevel() == level) // For example, abc FED 123 ^ CBA
@@ -384,7 +384,7 @@
}
while (nextBox && !nextBox->renderer().node())
- nextBox = nextBox->nextLeafChild();
+ nextBox = nextBox->nextLeafOnLine();
if (nextBox) {
box = nextBox;
@@ -393,7 +393,7 @@
if (box->bidiLevel() > level) {
do {
- nextBox = nextBox->nextLeafChild();
+ nextBox = nextBox->nextLeafOnLine();
} while (nextBox && nextBox->bidiLevel() > level);
if (!nextBox || nextBox->bidiLevel() < level)
@@ -402,7 +402,7 @@
} else {
// Trailing edge of a secondary run. Set to the leading edge of the entire run.
while (true) {
- while (InlineBox* prevBox = box->prevLeafChild()) {
+ while (InlineBox* prevBox = box->previousLeafOnLine()) {
if (prevBox->bidiLevel() < level)
break;
box = prevBox;
@@ -410,7 +410,7 @@
if (box->bidiLevel() == level)
break;
level = box->bidiLevel();
- while (InlineBox* nextBox = box->nextLeafChild()) {
+ while (InlineBox* nextBox = box->nextLeafOnLine()) {
if (nextBox->bidiLevel() < level)
break;
box = nextBox;
Modified: trunk/Source/WebCore/editing/VisibleUnits.cpp (250340 => 250341)
--- trunk/Source/WebCore/editing/VisibleUnits.cpp 2019-09-25 10:11:06 UTC (rev 250340)
+++ trunk/Source/WebCore/editing/VisibleUnits.cpp 2019-09-25 14:23:03 UTC (rev 250341)
@@ -824,7 +824,7 @@
} else {
// Generated content (e.g. list markers and CSS :before and :after pseudoelements) have no corresponding DOM element,
// and so cannot be represented by a VisiblePosition. Use whatever follows instead.
- startBox = rootBox->firstLeafChild();
+ startBox = rootBox->firstLeafDescendant();
while (true) {
if (!startBox)
return VisiblePosition();
@@ -833,7 +833,7 @@
if (startNode)
break;
- startBox = startBox->nextLeafChild();
+ startBox = startBox->nextLeafOnLine();
}
}
@@ -898,7 +898,7 @@
} else {
// Generated content (e.g. list markers and CSS :before and :after pseudoelements) have no corresponding DOM element,
// and so cannot be represented by a VisiblePosition. Use whatever precedes instead.
- endBox = rootBox->lastLeafChild();
+ endBox = rootBox->lastLeafDescendant();
while (true) {
if (!endBox)
return VisiblePosition();
@@ -907,7 +907,7 @@
if (endNode)
break;
- endBox = endBox->prevLeafChild();
+ endBox = endBox->previousLeafOnLine();
}
}
@@ -1046,7 +1046,7 @@
root = box->root().prevRootBox();
// We want to skip zero height boxes.
// This could happen in case it is a TrailingFloatsRootInlineBox.
- if (!root || !root->logicalHeight() || !root->firstLeafChild())
+ if (!root || !root->logicalHeight() || !root->firstLeafDescendant())
root = nullptr;
}
@@ -1101,7 +1101,7 @@
root = box->root().nextRootBox();
// We want to skip zero height boxes.
// This could happen in case it is a TrailingFloatsRootInlineBox.
- if (!root || !root->logicalHeight() || !root->firstLeafChild())
+ if (!root || !root->logicalHeight() || !root->firstLeafDescendant())
root = nullptr;
}
Modified: trunk/Source/WebCore/layout/Verification.cpp (250340 => 250341)
--- trunk/Source/WebCore/layout/Verification.cpp 2019-09-25 10:11:06 UTC (rev 250340)
+++ trunk/Source/WebCore/layout/Verification.cpp 2019-09-25 14:23:03 UTC (rev 250341)
@@ -127,13 +127,13 @@
static void collectFlowBoxSubtree(const InlineFlowBox& flowbox, Vector<WebCore::InlineBox*>& inlineBoxes)
{
- auto* inlineBox = flowbox.firstLeafChild();
- auto* lastLeafChild = flowbox.lastLeafChild();
+ auto* inlineBox = flowbox.firstLeafDescendant();
+ auto* lastLeafDescendant = flowbox.lastLeafDescendant();
while (inlineBox) {
inlineBoxes.append(inlineBox);
- if (inlineBox == lastLeafChild)
+ if (inlineBox == lastLeafDescendant)
break;
- inlineBox = inlineBox->nextLeafChild();
+ inlineBox = inlineBox->nextLeafOnLine();
}
}
Modified: trunk/Source/WebCore/rendering/ComplexLineLayout.cpp (250340 => 250341)
--- trunk/Source/WebCore/rendering/ComplexLineLayout.cpp 2019-09-25 10:11:06 UTC (rev 250340)
+++ trunk/Source/WebCore/rendering/ComplexLineLayout.cpp 2019-09-25 14:23:03 UTC (rev 250341)
@@ -570,7 +570,7 @@
float totalExpansion = 0;
unsigned totalOpportunitiesInRun = 0;
- for (auto* leafChild = rootBox.firstLeafChild(); leafChild; leafChild = leafChild->nextLeafChild()) {
+ for (auto* leafChild = rootBox.firstLeafDescendant(); leafChild; leafChild = leafChild->nextLeafOnLine()) {
if (!leafChild->isInlineTextBox())
continue;
@@ -735,7 +735,7 @@
if (nextRun && is<RenderRubyRun>(nextRun->renderer()) && downcast<RenderRubyRun>(nextRun->renderer()).rubyBase() && nextRun->renderer().style().collapseWhiteSpace()) {
auto& rubyBase = *downcast<RenderRubyRun>(nextRun->renderer()).rubyBase();
if (rubyBase.firstRootBox() && !rubyBase.firstRootBox()->nextRootBox()) {
- if (auto* leafChild = rubyBase.firstRootBox()->firstLeafChild()) {
+ if (auto* leafChild = rubyBase.firstRootBox()->firstLeafDescendant()) {
if (is<InlineTextBox>(*leafChild)) {
// FIXME: This leadingExpansionOpportunity doesn't actually work because it doesn't perform the UBA
if (FontCascade::leadingExpansionOpportunity(downcast<RenderText>(leafChild->renderer()).stringView(), leafChild->direction())) {
@@ -750,7 +750,7 @@
if (previousRun && is<RenderRubyRun>(previousRun->renderer()) && downcast<RenderRubyRun>(previousRun->renderer()).rubyBase() && previousRun->renderer().style().collapseWhiteSpace()) {
auto& rubyBase = *downcast<RenderRubyRun>(previousRun->renderer()).rubyBase();
if (rubyBase.firstRootBox() && !rubyBase.firstRootBox()->nextRootBox()) {
- if (auto* leafChild = rubyBase.firstRootBox()->lastLeafChild()) {
+ if (auto* leafChild = rubyBase.firstRootBox()->lastLeafDescendant()) {
if (is<InlineTextBox>(*leafChild)) {
// FIXME: This leadingExpansionOpportunity doesn't actually work because it doesn't perform the UBA
if (FontCascade::trailingExpansionOpportunity(downcast<RenderText>(leafChild->renderer()).stringView(), leafChild->direction())) {
@@ -764,10 +764,10 @@
// If we're the first box inside a ruby base, forbid a leading expansion, and vice-versa
if (is<RenderRubyBase>(block)) {
RenderRubyBase& rubyBase = downcast<RenderRubyBase>(block);
- if (&textBox == rubyBase.firstRootBox()->firstLeafChild()) {
+ if (&textBox == rubyBase.firstRootBox()->firstLeafDescendant()) {
setLeadingExpansion = true;
result |= ForbidLeadingExpansion;
- } if (&textBox == rubyBase.firstRootBox()->lastLeafChild()) {
+ } if (&textBox == rubyBase.firstRootBox()->lastLeafDescendant()) {
setTrailingExpansion = true;
result |= ForbidTrailingExpansion;
}
@@ -920,7 +920,7 @@
auto* rubyBase = downcast<RenderRubyRun>(run->renderer()).rubyBase();
if (rubyBase->firstRootBox() && !rubyBase->firstRootBox()->nextRootBox() && run->renderer().style().collapseWhiteSpace()) {
rubyBase->setIsAfterExpansion(isAfterExpansion);
- for (auto* leafChild = rubyBase->firstRootBox()->firstLeafChild(); leafChild; leafChild = leafChild->nextLeafChild()) {
+ for (auto* leafChild = rubyBase->firstRootBox()->firstLeafDescendant(); leafChild; leafChild = leafChild->nextLeafOnLine()) {
if (!is<InlineTextBox>(*leafChild))
continue;
encounteredJustifiedRuby = true;
@@ -1317,10 +1317,10 @@
// If the last line before the start line ends with a line break that clear floats,
// adjust the height accordingly.
// A line break can be either the first or the last object on a line, depending on its direction.
- if (InlineBox* lastLeafChild = lastRootBox()->lastLeafChild()) {
- RenderObject* lastObject = &lastLeafChild->renderer();
+ if (InlineBox* lastLeafDescendant = lastRootBox()->lastLeafDescendant()) {
+ RenderObject* lastObject = &lastLeafDescendant->renderer();
if (!lastObject->isBR())
- lastObject = &lastRootBox()->firstLeafChild()->renderer();
+ lastObject = &lastRootBox()->firstLeafDescendant()->renderer();
if (lastObject->isBR()) {
Clear clear = lastObject->style().clear();
if (clear != Clear::None)
Modified: trunk/Source/WebCore/rendering/InlineBox.cpp (250340 => 250341)
--- trunk/Source/WebCore/rendering/InlineBox.cpp 2019-09-25 10:11:06 UTC (rev 250340)
+++ trunk/Source/WebCore/rendering/InlineBox.cpp 2019-09-25 14:23:03 UTC (rev 250341)
@@ -220,42 +220,42 @@
{
if (!parent())
return false;
- if (prevOnLine())
+ if (previousOnLine())
return true;
return parent()->previousOnLineExists();
}
-InlineBox* InlineBox::nextLeafChild() const
+InlineBox* InlineBox::nextLeafOnLine() const
{
InlineBox* leaf = nullptr;
for (InlineBox* box = nextOnLine(); box && !leaf; box = box->nextOnLine())
- leaf = box->isLeaf() ? box : downcast<InlineFlowBox>(*box).firstLeafChild();
+ leaf = box->isLeaf() ? box : downcast<InlineFlowBox>(*box).firstLeafDescendant();
if (!leaf && parent())
- leaf = parent()->nextLeafChild();
+ leaf = parent()->nextLeafOnLine();
return leaf;
}
-InlineBox* InlineBox::prevLeafChild() const
+InlineBox* InlineBox::previousLeafOnLine() const
{
InlineBox* leaf = nullptr;
- for (InlineBox* box = prevOnLine(); box && !leaf; box = box->prevOnLine())
- leaf = box->isLeaf() ? box : downcast<InlineFlowBox>(*box).lastLeafChild();
+ for (InlineBox* box = previousOnLine(); box && !leaf; box = box->previousOnLine())
+ leaf = box->isLeaf() ? box : downcast<InlineFlowBox>(*box).lastLeafDescendant();
if (!leaf && parent())
- leaf = parent()->prevLeafChild();
+ leaf = parent()->previousLeafOnLine();
return leaf;
}
-InlineBox* InlineBox::nextLeafChildIgnoringLineBreak() const
+InlineBox* InlineBox::nextLeafOnLineIgnoringLineBreak() const
{
- InlineBox* leaf = nextLeafChild();
+ InlineBox* leaf = nextLeafOnLine();
if (leaf && leaf->isLineBreak())
return nullptr;
return leaf;
}
-InlineBox* InlineBox::prevLeafChildIgnoringLineBreak() const
+InlineBox* InlineBox::previousLeafOnLineIgnoringLineBreak() const
{
- InlineBox* leaf = prevLeafChild();
+ InlineBox* leaf = previousLeafOnLine();
if (leaf && leaf->isLineBreak())
return nullptr;
return leaf;
Modified: trunk/Source/WebCore/rendering/InlineBox.h (250340 => 250341)
--- trunk/Source/WebCore/rendering/InlineBox.h 2019-09-25 10:11:06 UTC (rev 250340)
+++ trunk/Source/WebCore/rendering/InlineBox.h 2019-09-25 14:23:03 UTC (rev 250341)
@@ -120,17 +120,17 @@
void removeFromParent();
- InlineBox* nextOnLine() const { return m_next; }
- InlineBox* prevOnLine() const { return m_prev; }
+ InlineBox* nextOnLine() const { return m_nextOnLine; }
+ InlineBox* previousOnLine() const { return m_previousOnLine; }
void setNextOnLine(InlineBox* next)
{
ASSERT(m_parent || !next);
- m_next = next;
+ m_nextOnLine = next;
}
- void setPrevOnLine(InlineBox* prev)
+ void setPreviousOnLine(InlineBox* previous)
{
- ASSERT(m_parent || !prev);
- m_prev = prev;
+ ASSERT(m_parent || !previous);
+ m_previousOnLine = previous;
}
bool nextOnLineExists() const;
bool previousOnLineExists() const;
@@ -137,14 +137,14 @@
virtual bool isLeaf() const { return true; }
- InlineBox* nextLeafChild() const;
- InlineBox* prevLeafChild() const;
+ InlineBox* nextLeafOnLine() const;
+ InlineBox* previousLeafOnLine() const;
// Helper functions for editing and hit-testing code.
// FIXME: These two functions should be moved to RenderedPosition once the code to convert between
// Position and inline box, offset pair is moved to RenderedPosition.
- InlineBox* nextLeafChildIgnoringLineBreak() const;
- InlineBox* prevLeafChildIgnoringLineBreak() const;
+ InlineBox* nextLeafOnLineIgnoringLineBreak() const;
+ InlineBox* previousLeafOnLineIgnoringLineBreak() const;
// FIXME: Hide this once all callers are using tighter types.
RenderObject& renderer() const { return m_renderer; }
@@ -287,8 +287,8 @@
void setForceLeadingExpansion() { m_bitfields.setForceLeadingExpansion(true); }
private:
- InlineBox* m_next { nullptr }; // The next element on the same line as us.
- InlineBox* m_prev { nullptr }; // The previous element on the same line as us.
+ InlineBox* m_nextOnLine { nullptr }; // The next element on the same line as us.
+ InlineBox* m_previousOnLine { nullptr }; // The previous element on the same line as us.
InlineFlowBox* m_parent { nullptr }; // The box that contains us.
@@ -383,9 +383,9 @@
{
}
- InlineBox(RenderObject& renderer, FloatPoint topLeft, float logicalWidth, bool firstLine, bool constructed, bool dirty, bool extracted, bool isHorizontal, InlineBox* next, InlineBox* prev, InlineFlowBox* parent)
- : m_next(next)
- , m_prev(prev)
+ InlineBox(RenderObject& renderer, FloatPoint topLeft, float logicalWidth, bool firstLine, bool constructed, bool dirty, bool extracted, bool isHorizontal, InlineBox* next, InlineBox* previous, InlineFlowBox* parent)
+ : m_nextOnLine(next)
+ , m_previousOnLine(previous)
, m_parent(parent)
, m_renderer(renderer)
, m_logicalWidth(logicalWidth)
Modified: trunk/Source/WebCore/rendering/InlineFlowBox.cpp (250340 => 250341)
--- trunk/Source/WebCore/rendering/InlineFlowBox.cpp 2019-09-25 10:11:06 UTC (rev 250340)
+++ trunk/Source/WebCore/rendering/InlineFlowBox.cpp 2019-09-25 14:23:03 UTC (rev 250341)
@@ -96,7 +96,7 @@
{
ASSERT(!child->parent());
ASSERT(!child->nextOnLine());
- ASSERT(!child->prevOnLine());
+ ASSERT(!child->previousOnLine());
checkConsistency();
child->setParent(this);
@@ -105,7 +105,7 @@
m_lastChild = child;
} else {
m_lastChild->setNextOnLine(child);
- child->setPrevOnLine(m_lastChild);
+ child->setPreviousOnLine(m_lastChild);
m_lastChild = child;
}
child->setIsFirstLine(isFirstLine());
@@ -195,11 +195,11 @@
if (child == m_firstChild)
m_firstChild = child->nextOnLine();
if (child == m_lastChild)
- m_lastChild = child->prevOnLine();
+ m_lastChild = child->previousOnLine();
if (child->nextOnLine())
- child->nextOnLine()->setPrevOnLine(child->prevOnLine());
- if (child->prevOnLine())
- child->prevOnLine()->setNextOnLine(child->nextOnLine());
+ child->nextOnLine()->setPreviousOnLine(child->previousOnLine());
+ if (child->previousOnLine())
+ child->previousOnLine()->setNextOnLine(child->nextOnLine());
child->setParent(nullptr);
@@ -1068,7 +1068,7 @@
// Check children first.
// We need to account for culled inline parents of the hit-tested nodes, so that they may also get included in area-based hit-tests.
RenderElement* culledParent = nullptr;
- for (InlineBox* child = lastChild(); child; child = child->prevOnLine()) {
+ for (InlineBox* child = lastChild(); child; child = child->previousOnLine()) {
if (is<RenderText>(child->renderer()) || !child->boxModelObject()->hasSelfPaintingLayer()) {
RenderElement* newParent = nullptr;
// Culled parents are only relevant for area-based hit-tests, so ignore it in point-based ones.
@@ -1489,19 +1489,19 @@
paintInfo.context().endTransparencyLayer();
}
-InlineBox* InlineFlowBox::firstLeafChild() const
+InlineBox* InlineFlowBox::firstLeafDescendant() const
{
InlineBox* leaf = nullptr;
for (InlineBox* child = firstChild(); child && !leaf; child = child->nextOnLine())
- leaf = child->isLeaf() ? child : downcast<InlineFlowBox>(*child).firstLeafChild();
+ leaf = child->isLeaf() ? child : downcast<InlineFlowBox>(*child).firstLeafDescendant();
return leaf;
}
-InlineBox* InlineFlowBox::lastLeafChild() const
+InlineBox* InlineFlowBox::lastLeafDescendant() const
{
InlineBox* leaf = nullptr;
- for (InlineBox* child = lastChild(); child && !leaf; child = child->prevOnLine())
- leaf = child->isLeaf() ? child : downcast<InlineFlowBox>(*child).lastLeafChild();
+ for (InlineBox* child = lastChild(); child && !leaf; child = child->previousOnLine())
+ leaf = child->isLeaf() ? child : downcast<InlineFlowBox>(*child).lastLeafDescendant();
return leaf;
}
@@ -1543,7 +1543,7 @@
}
else {
visibleRightEdge -= box->logicalWidth();
- box = box->prevOnLine();
+ box = box->previousOnLine();
}
}
return result;
@@ -1653,7 +1653,7 @@
void InlineFlowBox::collectLeafBoxesInLogicalOrder(Vector<InlineBox*>& leafBoxesInLogicalOrder, CustomInlineBoxRangeReverse customReverseImplementation, void* userData) const
{
- InlineBox* leaf = firstLeafChild();
+ InlineBox* leaf = firstLeafDescendant();
// FIXME: The reordering code is a copy of parts from BidiResolver::createBidiRunsForLine, operating directly on InlineBoxes, instead of BidiRuns.
// Investigate on how this code could possibly be shared.
@@ -1661,7 +1661,7 @@
unsigned char maxLevel = 0;
// First find highest and lowest levels, and initialize leafBoxesInLogicalOrder with the leaf boxes in visual order.
- for (; leaf; leaf = leaf->nextLeafChild()) {
+ for (; leaf; leaf = leaf->nextLeafOnLine()) {
minLevel = std::min(minLevel, leaf->bidiLevel());
maxLevel = std::max(maxLevel, leaf->bidiLevel());
leafBoxesInLogicalOrder.append(leaf);
@@ -1744,7 +1744,7 @@
const InlineBox* previousChild = nullptr;
for (const InlineBox* child = firstChild(); child; child = child->nextOnLine()) {
ASSERT(child->parent() == this);
- ASSERT(child->prevOnLine() == previousChild);
+ ASSERT(child->previousOnLine() == previousChild);
previousChild = child;
}
ASSERT(previousChild == m_lastChild);
Modified: trunk/Source/WebCore/rendering/InlineFlowBox.h (250340 => 250341)
--- trunk/Source/WebCore/rendering/InlineFlowBox.h 2019-09-25 10:11:06 UTC (rev 250340)
+++ trunk/Source/WebCore/rendering/InlineFlowBox.h 2019-09-25 14:23:03 UTC (rev 250341)
@@ -88,8 +88,8 @@
bool isLeaf() const final { return false; }
- InlineBox* firstLeafChild() const;
- InlineBox* lastLeafChild() const;
+ InlineBox* firstLeafDescendant() const;
+ InlineBox* lastLeafDescendant() const;
typedef void (*CustomInlineBoxRangeReverse)(void* userData, Vector<InlineBox*>::iterator first, Vector<InlineBox*>::iterator last);
void collectLeafBoxesInLogicalOrder(Vector<InlineBox*>&, CustomInlineBoxRangeReverse customReverseImplementation = nullptr, void* userData = nullptr) const;
Modified: trunk/Source/WebCore/rendering/InlineTextBox.cpp (250340 => 250341)
--- trunk/Source/WebCore/rendering/InlineTextBox.cpp 2019-09-25 10:11:06 UTC (rev 250340)
+++ trunk/Source/WebCore/rendering/InlineTextBox.cpp 2019-09-25 14:23:03 UTC (rev 250341)
@@ -1304,7 +1304,7 @@
ExpansionBehavior trailingBehavior;
if (forceTrailingExpansion())
trailingBehavior = ForceTrailingExpansion;
- else if (expansion() && nextLeafChild() && !nextLeafChild()->isLineBreak())
+ else if (expansion() && nextLeafOnLine() && !nextLeafOnLine()->isLineBreak())
trailingBehavior = AllowTrailingExpansion;
else
trailingBehavior = ForbidTrailingExpansion;
Modified: trunk/Source/WebCore/rendering/RenderBlockFlow.cpp (250340 => 250341)
--- trunk/Source/WebCore/rendering/RenderBlockFlow.cpp 2019-09-25 10:11:06 UTC (rev 250340)
+++ trunk/Source/WebCore/rendering/RenderBlockFlow.cpp 2019-09-25 14:23:03 UTC (rev 250341)
@@ -3328,7 +3328,7 @@
bool RenderBlockFlow::containsNonZeroBidiLevel() const
{
for (auto* root = firstRootBox(); root; root = root->nextRootBox()) {
- for (auto* box = root->firstLeafChild(); box; box = box->nextLeafChild()) {
+ for (auto* box = root->firstLeafDescendant(); box; box = box->nextLeafOnLine()) {
if (box->bidiLevel())
return true;
}
@@ -3436,7 +3436,7 @@
if (fragment && root->containingFragment() != fragment)
continue;
- if (!root->firstLeafChild())
+ if (!root->firstLeafDescendant())
continue;
if (!firstRootBoxWithChildren)
firstRootBoxWithChildren = root;
@@ -3451,7 +3451,7 @@
if (pointInLogicalContents.y() < root->selectionBottom() || (blocksAreFlipped && pointInLogicalContents.y() == root->selectionBottom())) {
if (linesAreFlipped) {
RootInlineBox* nextRootBoxWithChildren = root->nextRootBox();
- while (nextRootBoxWithChildren && !nextRootBoxWithChildren->firstLeafChild())
+ while (nextRootBoxWithChildren && !nextRootBoxWithChildren->firstLeafDescendant())
nextRootBoxWithChildren = nextRootBoxWithChildren->nextRootBox();
if (nextRootBoxWithChildren && nextRootBoxWithChildren->isFirstAfterPageBreak() && (pointInLogicalContents.y() > nextRootBoxWithChildren->lineTopWithLeading()
@@ -3476,9 +3476,9 @@
LayoutUnit firstRootBoxWithChildrenTop = std::min(firstRootBoxWithChildren->selectionTop(), LayoutUnit(firstRootBoxWithChildren->logicalTop()));
if (pointInLogicalContents.y() < firstRootBoxWithChildrenTop
|| (blocksAreFlipped && pointInLogicalContents.y() == firstRootBoxWithChildrenTop)) {
- InlineBox* box = firstRootBoxWithChildren->firstLeafChild();
+ InlineBox* box = firstRootBoxWithChildren->firstLeafDescendant();
if (box->isLineBreak()) {
- if (InlineBox* newBox = box->nextLeafChildIgnoringLineBreak())
+ if (InlineBox* newBox = box->nextLeafOnLineIgnoringLineBreak())
box = newBox;
}
// y coordinate is above first root line box, so return the start of the first
Modified: trunk/Source/WebCore/rendering/RenderTextLineBoxes.cpp (250340 => 250341)
--- trunk/Source/WebCore/rendering/RenderTextLineBoxes.cpp 2019-09-25 10:11:06 UTC (rev 250340)
+++ trunk/Source/WebCore/rendering/RenderTextLineBoxes.cpp 2019-09-25 14:23:03 UTC (rev 250341)
@@ -275,7 +275,7 @@
// the affinity must be downstream so the position doesn't jump back to the previous line
// except when box is the first box in the line
if (pointLineDirection <= box.logicalLeft()) {
- shouldAffinityBeDownstream = !box.prevLeafChild() ? UpstreamIfPositionIsNotAtStart : AlwaysDownstream;
+ shouldAffinityBeDownstream = !box.previousLeafOnLine() ? UpstreamIfPositionIsNotAtStart : AlwaysDownstream;
return true;
}
@@ -290,10 +290,10 @@
// box is first on line
// and the x coordinate is to the left of the first text box left edge
- if (!box.prevLeafChildIgnoringLineBreak() && pointLineDirection < box.logicalLeft())
+ if (!box.previousLeafOnLineIgnoringLineBreak() && pointLineDirection < box.logicalLeft())
return true;
- if (!box.nextLeafChildIgnoringLineBreak()) {
+ if (!box.nextLeafOnLineIgnoringLineBreak()) {
// box is last on line
// and the x coordinate is to the right of the last text box right edge
// generate VisiblePosition, use UPSTREAM affinity if possible
@@ -332,7 +332,7 @@
if (positionIsAtStartOfBox == box.isLeftToRightDirection()) {
// offset is on the left edge
- const InlineBox* prevBox = box.prevLeafChildIgnoringLineBreak();
+ const InlineBox* prevBox = box.previousLeafOnLineIgnoringLineBreak();
if ((prevBox && prevBox->bidiLevel() == box.bidiLevel())
|| box.renderer().containingBlock()->style().direction() == box.direction()) // FIXME: left on 12CBA
return createVisiblePositionForBox(box, box.caretLeftmostOffset(), shouldAffinityBeDownstream);
@@ -342,7 +342,7 @@
const InlineBox* leftmostBox;
do {
leftmostBox = prevBox;
- prevBox = leftmostBox->prevLeafChildIgnoringLineBreak();
+ prevBox = leftmostBox->previousLeafOnLineIgnoringLineBreak();
} while (prevBox && prevBox->bidiLevel() > box.bidiLevel());
return createVisiblePositionForBox(*leftmostBox, leftmostBox->caretRightmostOffset(), shouldAffinityBeDownstream);
}
@@ -353,7 +353,7 @@
const InlineBox* nextBox = &box;
do {
rightmostBox = nextBox;
- nextBox = rightmostBox->nextLeafChildIgnoringLineBreak();
+ nextBox = rightmostBox->nextLeafOnLineIgnoringLineBreak();
} while (nextBox && nextBox->bidiLevel() >= box.bidiLevel());
return createVisiblePositionForBox(*rightmostBox,
box.isLeftToRightDirection() ? rightmostBox->caretMaxOffset() : rightmostBox->caretMinOffset(), shouldAffinityBeDownstream);
@@ -362,7 +362,7 @@
return createVisiblePositionForBox(box, box.caretRightmostOffset(), shouldAffinityBeDownstream);
}
- const InlineBox* nextBox = box.nextLeafChildIgnoringLineBreak();
+ const InlineBox* nextBox = box.nextLeafOnLineIgnoringLineBreak();
if ((nextBox && nextBox->bidiLevel() == box.bidiLevel())
|| box.renderer().containingBlock()->style().direction() == box.direction())
return createVisiblePositionForBox(box, box.caretRightmostOffset(), shouldAffinityBeDownstream);
@@ -373,7 +373,7 @@
const InlineBox* rightmostBox;
do {
rightmostBox = nextBox;
- nextBox = rightmostBox->nextLeafChildIgnoringLineBreak();
+ nextBox = rightmostBox->nextLeafOnLineIgnoringLineBreak();
} while (nextBox && nextBox->bidiLevel() > box.bidiLevel());
return createVisiblePositionForBox(*rightmostBox, rightmostBox->caretLeftmostOffset(), shouldAffinityBeDownstream);
}
@@ -384,7 +384,7 @@
const InlineBox* prevBox = &box;
do {
leftmostBox = prevBox;
- prevBox = leftmostBox->prevLeafChildIgnoringLineBreak();
+ prevBox = leftmostBox->previousLeafOnLineIgnoringLineBreak();
} while (prevBox && prevBox->bidiLevel() >= box.bidiLevel());
return createVisiblePositionForBox(*leftmostBox,
box.isLeftToRightDirection() ? leftmostBox->caretMinOffset() : leftmostBox->caretMaxOffset(), shouldAffinityBeDownstream);
@@ -404,7 +404,7 @@
InlineTextBox* lastBox = nullptr;
for (auto* box = m_first; box; box = box->nextTextBox()) {
- if (box->isLineBreak() && !box->prevLeafChild() && box->nextLeafChild() && !box->nextLeafChild()->isLineBreak())
+ if (box->isLineBreak() && !box->previousLeafOnLine() && box->nextLeafOnLine() && !box->nextLeafOnLine()->isLineBreak())
box = box->nextTextBox();
auto& rootBox = box->root();
Modified: trunk/Source/WebCore/rendering/RootInlineBox.cpp (250340 => 250341)
--- trunk/Source/WebCore/rendering/RootInlineBox.cpp 2019-09-25 10:11:06 UTC (rev 250340)
+++ trunk/Source/WebCore/rendering/RootInlineBox.cpp 2019-09-25 14:23:03 UTC (rev 250341)
@@ -94,7 +94,7 @@
bool RootInlineBox::isHyphenated() const
{
- for (InlineBox* box = firstLeafChild(); box; box = box->nextLeafChild()) {
+ for (InlineBox* box = firstLeafDescendant(); box; box = box->nextLeafOnLine()) {
if (is<InlineTextBox>(*box) && downcast<InlineTextBox>(*box).hasHyphen())
return true;
}
@@ -452,7 +452,7 @@
// Now fill in any gaps on the line that occurred between two selected elements.
LayoutUnit lastLogicalLeft { firstBox->logicalRight() };
bool isPreviousBoxSelected = firstBox->selectionState() != RenderObject::SelectionNone;
- for (InlineBox* box = firstBox->nextLeafChild(); box; box = box->nextLeafChild()) {
+ for (InlineBox* box = firstBox->nextLeafOnLine(); box; box = box->nextLeafOnLine()) {
if (box->selectionState() != RenderObject::SelectionNone) {
LayoutRect logicalRect { lastLogicalLeft, selTop, LayoutUnit(box->logicalLeft() - lastLogicalLeft), selHeight };
logicalRect.move(renderer().isHorizontalWritingMode() ? offsetFromRootBlock : LayoutSize(offsetFromRootBlock.height(), offsetFromRootBlock.width()));
@@ -531,7 +531,7 @@
{
// Walk over all of the selected boxes.
RenderObject::SelectionState state = RenderObject::SelectionNone;
- for (InlineBox* box = firstLeafChild(); box; box = box->nextLeafChild()) {
+ for (InlineBox* box = firstLeafDescendant(); box; box = box->nextLeafOnLine()) {
RenderObject::SelectionState boxState = box->selectionState();
if ((boxState == RenderObject::SelectionStart && state == RenderObject::SelectionEnd) ||
(boxState == RenderObject::SelectionEnd && state == RenderObject::SelectionStart))
@@ -553,7 +553,7 @@
InlineBox* RootInlineBox::firstSelectedBox()
{
- for (auto* box = firstLeafChild(); box; box = box->nextLeafChild()) {
+ for (auto* box = firstLeafDescendant(); box; box = box->nextLeafOnLine()) {
if (box->selectionState() != RenderObject::SelectionNone)
return box;
}
@@ -562,7 +562,7 @@
InlineBox* RootInlineBox::lastSelectedBox()
{
- for (auto* box = lastLeafChild(); box; box = box->prevLeafChild()) {
+ for (auto* box = lastLeafDescendant(); box; box = box->previousLeafOnLine()) {
if (box->selectionState() != RenderObject::SelectionNone)
return box;
}
@@ -766,14 +766,14 @@
InlineBox* RootInlineBox::closestLeafChildForLogicalLeftPosition(int leftPosition, bool onlyEditableLeaves)
{
- InlineBox* firstLeaf = firstLeafChild();
- InlineBox* lastLeaf = lastLeafChild();
+ InlineBox* firstLeaf = firstLeafDescendant();
+ InlineBox* lastLeaf = lastLeafDescendant();
if (firstLeaf != lastLeaf) {
if (firstLeaf->isLineBreak())
- firstLeaf = firstLeaf->nextLeafChildIgnoringLineBreak();
+ firstLeaf = firstLeaf->nextLeafOnLineIgnoringLineBreak();
else if (lastLeaf->isLineBreak())
- lastLeaf = lastLeaf->prevLeafChildIgnoringLineBreak();
+ lastLeaf = lastLeaf->previousLeafOnLineIgnoringLineBreak();
}
if (firstLeaf == lastLeaf && (!onlyEditableLeaves || isEditableLeaf(firstLeaf)))
@@ -791,7 +791,7 @@
return lastLeaf;
InlineBox* closestLeaf = nullptr;
- for (InlineBox* leaf = firstLeaf; leaf; leaf = leaf->nextLeafChildIgnoringLineBreak()) {
+ for (InlineBox* leaf = firstLeaf; leaf; leaf = leaf->nextLeafOnLineIgnoringLineBreak()) {
if (!leaf->renderer().isListMarker() && (!onlyEditableLeaves || isEditableLeaf(leaf))) {
closestLeaf = leaf;
if (leftPosition < leaf->logicalRight())
Modified: trunk/Source/WebCore/rendering/svg/SVGRootInlineBox.cpp (250340 => 250341)
--- trunk/Source/WebCore/rendering/svg/SVGRootInlineBox.cpp 2019-09-25 10:11:06 UTC (rev 250340)
+++ trunk/Source/WebCore/rendering/svg/SVGRootInlineBox.cpp 2019-09-25 14:23:03 UTC (rev 250341)
@@ -190,14 +190,14 @@
InlineBox* SVGRootInlineBox::closestLeafChildForPosition(const LayoutPoint& point)
{
- InlineBox* firstLeaf = firstLeafChild();
- InlineBox* lastLeaf = lastLeafChild();
+ InlineBox* firstLeaf = firstLeafDescendant();
+ InlineBox* lastLeaf = lastLeafDescendant();
if (firstLeaf == lastLeaf)
return firstLeaf;
// FIXME: Check for vertical text!
InlineBox* closestLeaf = nullptr;
- for (InlineBox* leaf = firstLeaf; leaf; leaf = leaf->nextLeafChild()) {
+ for (InlineBox* leaf = firstLeaf; leaf; leaf = leaf->nextLeafOnLine()) {
if (!leaf->isSVGInlineTextBox())
continue;
if (point.y() < leaf->y())
@@ -215,7 +215,7 @@
bool SVGRootInlineBox::nodeAtPoint(const HitTestRequest& request, HitTestResult& result, const HitTestLocation& locationInContainer, const LayoutPoint& accumulatedOffset, LayoutUnit lineTop, LayoutUnit lineBottom, HitTestAction hitTestAction)
{
- for (InlineBox* leaf = firstLeafChild(); leaf; leaf = leaf->nextLeafChild()) {
+ for (InlineBox* leaf = firstLeafDescendant(); leaf; leaf = leaf->nextLeafOnLine()) {
if (!leaf->isSVGInlineTextBox())
continue;
if (leaf->nodeAtPoint(request, result, locationInContainer, accumulatedOffset, lineTop, lineBottom, hitTestAction))