Diff
Modified: trunk/Source/WebCore/ChangeLog (283546 => 283547)
--- trunk/Source/WebCore/ChangeLog 2021-10-05 12:10:00 UTC (rev 283546)
+++ trunk/Source/WebCore/ChangeLog 2021-10-05 13:54:20 UTC (rev 283547)
@@ -1,3 +1,74 @@
+2021-10-05 Antti Koivisto <[email protected]>
+
+ [LFC][Integration] Split BoxIterator into a base class and LeafBoxIterator
+ https://bugs.webkit.org/show_bug.cgi?id=231229
+
+ Reviewed by Alan Bujtas.
+
+ LeafBoxIterator contains function for traversing non-inline boxes.
+ BoxIterator becomes a non-instantiated base class.
+
+ This is in preparation for adding InlineBoxIterator.
+
+ * dom/Position.cpp:
+ (WebCore::Position::inlineRunAndOffset const):
+ * editing/InlineRunAndOffset.h:
+ * editing/RenderedPosition.cpp:
+ (WebCore::RenderedPosition::RenderedPosition):
+ (WebCore::RenderedPosition::previousLeafOnLine const):
+ (WebCore::RenderedPosition::nextLeafOnLine const):
+ * editing/RenderedPosition.h:
+ * editing/VisibleUnits.cpp:
+ (WebCore::isTextOrLineBreakRun):
+ (WebCore::previousTextOrLineBreakRun):
+ (WebCore::nextTextOrLineBreakRun):
+ (WebCore::startTextOrLineBreakRun):
+ (WebCore::endTextOrLineBreakRun):
+ (WebCore::logicallyPreviousRun):
+ (WebCore::logicallyNextRun):
+ (WebCore::visualWordPosition):
+ * layout/integration/InlineIteratorBox.cpp:
+ (WebCore::InlineIterator::Box::nextOnLine const):
+ (WebCore::InlineIterator::Box::previousOnLine const):
+ (WebCore::InlineIterator::Box::nextOnLineIgnoringLineBreak const):
+ (WebCore::InlineIterator::Box::previousOnLineIgnoringLineBreak const):
+ (WebCore::InlineIterator::LeafBoxIterator::LeafBoxIterator):
+ (WebCore::InlineIterator::LeafBoxIterator::traverseNextOnLine):
+ (WebCore::InlineIterator::LeafBoxIterator::traversePreviousOnLine):
+ (WebCore::InlineIterator::LeafBoxIterator::traverseNextOnLineIgnoringLineBreak):
+ (WebCore::InlineIterator::LeafBoxIterator::traversePreviousOnLineIgnoringLineBreak):
+ (WebCore::InlineIterator::LeafBoxIterator::traverseNextOnLineInLogicalOrder):
+ (WebCore::InlineIterator::LeafBoxIterator::traversePreviousOnLineInLogicalOrder):
+ (WebCore::InlineIterator::boxFor):
+ (WebCore::InlineIterator::BoxIterator::traverseNextOnLine): Deleted.
+ (WebCore::InlineIterator::BoxIterator::traversePreviousOnLine): Deleted.
+ (WebCore::InlineIterator::BoxIterator::traverseNextOnLineIgnoringLineBreak): Deleted.
+ (WebCore::InlineIterator::BoxIterator::traversePreviousOnLineIgnoringLineBreak): Deleted.
+ (WebCore::InlineIterator::BoxIterator::traverseNextOnLineInLogicalOrder): Deleted.
+ (WebCore::InlineIterator::BoxIterator::traversePreviousOnLineInLogicalOrder): Deleted.
+ * layout/integration/InlineIteratorBox.h:
+ (WebCore::InlineIterator::BoxIterator::BoxIterator):
+ * layout/integration/InlineIteratorLine.cpp:
+ (WebCore::InlineIterator::Line::firstRun const):
+ (WebCore::InlineIterator::Line::lastRun const):
+ (WebCore::InlineIterator::Line::logicalStartRun const):
+ (WebCore::InlineIterator::Line::logicalEndRun const):
+ (WebCore::InlineIterator::Line::logicalStartRunWithNode const):
+ (WebCore::InlineIterator::Line::logicalEndRunWithNode const):
+ (WebCore::InlineIterator::Line::closestRunForPoint const):
+ (WebCore::InlineIterator::Line::closestRunForLogicalLeftPosition const):
+ (WebCore::InlineIterator::Line::firstSelectedBox const):
+ (WebCore::InlineIterator::Line::lastSelectedBox const):
+ * layout/integration/InlineIteratorLine.h:
+ * layout/integration/InlineIteratorTextBox.cpp:
+ (WebCore::InlineIterator::TextBoxIterator::TextBoxIterator):
+ * layout/integration/InlineIteratorTextBox.h:
+ * layout/integration/LayoutIntegrationLineLayout.cpp:
+ (WebCore::LayoutIntegration::LineLayout::boxFor const):
+ * layout/integration/LayoutIntegrationLineLayout.h:
+ * rendering/RenderBlockFlow.cpp:
+ (WebCore::RenderBlockFlow::positionForPointWithInlineChildren):
+
2021-10-05 Martin Robinson <[email protected]>
[css-position-sticky] scrollIntoView should not take into account sticky positioning offsets
Modified: trunk/Source/WebCore/dom/Position.cpp (283546 => 283547)
--- trunk/Source/WebCore/dom/Position.cpp 2021-10-05 12:10:00 UTC (rev 283546)
+++ trunk/Source/WebCore/dom/Position.cpp 2021-10-05 13:54:20 UTC (rev 283547)
@@ -1210,7 +1210,7 @@
if (!renderer)
return { { }, caretOffset };
- InlineIterator::BoxIterator run;
+ InlineIterator::LeafBoxIterator run;
if (renderer->isBR()) {
auto& lineBreakRenderer = downcast<RenderLineBreak>(*renderer);
Modified: trunk/Source/WebCore/editing/InlineRunAndOffset.h (283546 => 283547)
--- trunk/Source/WebCore/editing/InlineRunAndOffset.h 2021-10-05 12:10:00 UTC (rev 283546)
+++ trunk/Source/WebCore/editing/InlineRunAndOffset.h 2021-10-05 13:54:20 UTC (rev 283547)
@@ -30,7 +30,7 @@
namespace WebCore {
struct InlineRunAndOffset {
- InlineIterator::BoxIterator run { };
+ InlineIterator::LeafBoxIterator run { };
unsigned offset { 0 };
};
Modified: trunk/Source/WebCore/editing/RenderedPosition.cpp (283546 => 283547)
--- trunk/Source/WebCore/editing/RenderedPosition.cpp 2021-10-05 12:10:00 UTC (rev 283546)
+++ trunk/Source/WebCore/editing/RenderedPosition.cpp 2021-10-05 13:54:20 UTC (rev 283547)
@@ -69,7 +69,7 @@
{
}
-RenderedPosition::RenderedPosition(const RenderObject* renderer, InlineIterator::BoxIterator run, unsigned offset)
+RenderedPosition::RenderedPosition(const RenderObject* renderer, InlineIterator::LeafBoxIterator run, unsigned offset)
: m_renderer(renderer)
, m_run(run)
, m_offset(offset)
@@ -95,7 +95,7 @@
m_renderer = rendererFromPosition(position);
}
-InlineIterator::BoxIterator RenderedPosition::previousLeafOnLine() const
+InlineIterator::LeafBoxIterator RenderedPosition::previousLeafOnLine() const
{
if (!m_previousLeafOnLine)
m_previousLeafOnLine = m_run->previousOnLineIgnoringLineBreak();
@@ -102,7 +102,7 @@
return *m_previousLeafOnLine;
}
-InlineIterator::BoxIterator RenderedPosition::nextLeafOnLine() const
+InlineIterator::LeafBoxIterator RenderedPosition::nextLeafOnLine() const
{
if (!m_nextLeafOnLine)
m_nextLeafOnLine = m_run->nextOnLineIgnoringLineBreak();
Modified: trunk/Source/WebCore/editing/RenderedPosition.h (283546 => 283547)
--- trunk/Source/WebCore/editing/RenderedPosition.h 2021-10-05 12:10:00 UTC (rev 283546)
+++ trunk/Source/WebCore/editing/RenderedPosition.h 2021-10-05 13:54:20 UTC (rev 283547)
@@ -72,10 +72,10 @@
private:
bool operator==(const RenderedPosition&) const { return false; }
- explicit RenderedPosition(const RenderObject*, InlineIterator::BoxIterator, unsigned offset);
+ explicit RenderedPosition(const RenderObject*, InlineIterator::LeafBoxIterator, unsigned offset);
- InlineIterator::BoxIterator previousLeafOnLine() const;
- InlineIterator::BoxIterator nextLeafOnLine() const;
+ InlineIterator::LeafBoxIterator previousLeafOnLine() const;
+ InlineIterator::LeafBoxIterator nextLeafOnLine() const;
bool atLeftmostOffsetInBox() const { return m_run && m_offset == m_run->leftmostCaretOffset(); }
bool atRightmostOffsetInBox() const { return m_run && m_offset == m_run->rightmostCaretOffset(); }
bool atLeftBoundaryOfBidiRun(ShouldMatchBidiLevel, unsigned char bidiLevelOfRun) const;
@@ -82,11 +82,11 @@
bool atRightBoundaryOfBidiRun(ShouldMatchBidiLevel, unsigned char bidiLevelOfRun) const;
const RenderObject* m_renderer { nullptr };
- InlineIterator::BoxIterator m_run;
+ InlineIterator::LeafBoxIterator m_run;
unsigned m_offset { 0 };
- mutable std::optional<InlineIterator::BoxIterator> m_previousLeafOnLine;
- mutable std::optional<InlineIterator::BoxIterator> m_nextLeafOnLine;
+ mutable std::optional<InlineIterator::LeafBoxIterator> m_previousLeafOnLine;
+ mutable std::optional<InlineIterator::LeafBoxIterator> m_nextLeafOnLine;
};
bool renderObjectContainsPosition(const RenderObject*, const Position&);
Modified: trunk/Source/WebCore/editing/VisibleUnits.cpp (283546 => 283547)
--- trunk/Source/WebCore/editing/VisibleUnits.cpp 2021-10-05 12:10:00 UTC (rev 283546)
+++ trunk/Source/WebCore/editing/VisibleUnits.cpp 2021-10-05 13:54:20 UTC (rev 283547)
@@ -124,12 +124,12 @@
return Position();
}
-static bool isTextOrLineBreakRun(InlineIterator::BoxIterator run)
+static bool isTextOrLineBreakRun(InlineIterator::LeafBoxIterator run)
{
return run && (run->isText() || run->renderer().isBR());
}
-static InlineIterator::BoxIterator previousTextOrLineBreakRun(InlineIterator::BoxIterator run)
+static InlineIterator::LeafBoxIterator previousTextOrLineBreakRun(InlineIterator::LeafBoxIterator run)
{
while (run) {
run.traversePreviousOnLineInLogicalOrder();
@@ -139,7 +139,7 @@
return { };
}
-static InlineIterator::BoxIterator nextTextOrLineBreakRun(InlineIterator::BoxIterator run)
+static InlineIterator::LeafBoxIterator nextTextOrLineBreakRun(InlineIterator::LeafBoxIterator run)
{
while (run) {
run.traverseNextOnLineInLogicalOrder();
@@ -149,7 +149,7 @@
return { };
}
-static InlineIterator::BoxIterator startTextOrLineBreakRun(InlineIterator::LineIterator line)
+static InlineIterator::LeafBoxIterator startTextOrLineBreakRun(InlineIterator::LineIterator line)
{
auto run = line->logicalStartRun();
if (isTextOrLineBreakRun(run))
@@ -157,7 +157,7 @@
return nextTextOrLineBreakRun(run);
}
-static InlineIterator::BoxIterator endTextOrLineBreakRun(InlineIterator::LineIterator line)
+static InlineIterator::LeafBoxIterator endTextOrLineBreakRun(InlineIterator::LineIterator line)
{
auto run = line->logicalEndRun();
if (isTextOrLineBreakRun(run))
@@ -165,7 +165,7 @@
return previousTextOrLineBreakRun(run);
}
-static const InlineIterator::BoxIterator logicallyPreviousRun(const VisiblePosition& visiblePosition, InlineIterator::BoxIterator startRun, bool& previousBoxInDifferentLine)
+static const InlineIterator::LeafBoxIterator logicallyPreviousRun(const VisiblePosition& visiblePosition, InlineIterator::LeafBoxIterator startRun, bool& previousBoxInDifferentLine)
{
if (auto previousRun = previousTextOrLineBreakRun(startRun))
return previousRun;
@@ -203,7 +203,7 @@
}
-static const InlineIterator::BoxIterator logicallyNextRun(const VisiblePosition& visiblePosition, InlineIterator::BoxIterator startRun, bool& nextBoxInDifferentLine)
+static const InlineIterator::LeafBoxIterator logicallyNextRun(const VisiblePosition& visiblePosition, InlineIterator::LeafBoxIterator startRun, bool& nextBoxInDifferentLine)
{
if (auto nextRun = nextTextOrLineBreakRun(startRun))
return nextRun;
@@ -315,7 +315,7 @@
visiblePosition.deepEquivalent().document()->updateLayoutIgnorePendingStylesheets();
TextDirection blockDirection = directionOfEnclosingBlock(visiblePosition.deepEquivalent());
- InlineIterator::BoxIterator previouslyVisitedRun;
+ InlineIterator::LeafBoxIterator previouslyVisitedRun;
VisiblePosition current = visiblePosition;
std::optional<VisiblePosition> previousPosition;
UBreakIterator* iter = nullptr;
Modified: trunk/Source/WebCore/layout/integration/InlineIteratorBox.cpp (283546 => 283547)
--- trunk/Source/WebCore/layout/integration/InlineIteratorBox.cpp 2021-10-05 12:10:00 UTC (rev 283546)
+++ trunk/Source/WebCore/layout/integration/InlineIteratorBox.cpp 2021-10-05 13:54:20 UTC (rev 283547)
@@ -58,24 +58,24 @@
});
}
-BoxIterator Box::nextOnLine() const
+LeafBoxIterator Box::nextOnLine() const
{
- return BoxIterator(*this).traverseNextOnLine();
+ return LeafBoxIterator(*this).traverseNextOnLine();
}
-BoxIterator Box::previousOnLine() const
+LeafBoxIterator Box::previousOnLine() const
{
- return BoxIterator(*this).traversePreviousOnLine();
+ return LeafBoxIterator(*this).traversePreviousOnLine();
}
-BoxIterator Box::nextOnLineIgnoringLineBreak() const
+LeafBoxIterator Box::nextOnLineIgnoringLineBreak() const
{
- return BoxIterator(*this).traverseNextOnLineIgnoringLineBreak();
+ return LeafBoxIterator(*this).traverseNextOnLineIgnoringLineBreak();
}
-BoxIterator Box::previousOnLineIgnoringLineBreak() const
+LeafBoxIterator Box::previousOnLineIgnoringLineBreak() const
{
- return BoxIterator(*this).traversePreviousOnLineIgnoringLineBreak();
+ return LeafBoxIterator(*this).traversePreviousOnLineIgnoringLineBreak();
}
LineIterator Box::line() const
@@ -106,8 +106,18 @@
return renderer().selectionState();
}
-BoxIterator& BoxIterator::traverseNextOnLine()
+LeafBoxIterator::LeafBoxIterator(Box::PathVariant&& pathVariant)
+ : BoxIterator(WTFMove(pathVariant))
{
+}
+
+LeafBoxIterator::LeafBoxIterator(const Box& run)
+ : BoxIterator(run)
+{
+}
+
+LeafBoxIterator& LeafBoxIterator::traverseNextOnLine()
+{
WTF::switchOn(m_box.m_pathVariant, [](auto& path) {
path.traverseNextOnLine();
});
@@ -114,7 +124,7 @@
return *this;
}
-BoxIterator& BoxIterator::traversePreviousOnLine()
+LeafBoxIterator& LeafBoxIterator::traversePreviousOnLine()
{
WTF::switchOn(m_box.m_pathVariant, [](auto& path) {
path.traversePreviousOnLine();
@@ -122,7 +132,7 @@
return *this;
}
-BoxIterator& BoxIterator::traverseNextOnLineIgnoringLineBreak()
+LeafBoxIterator& LeafBoxIterator::traverseNextOnLineIgnoringLineBreak()
{
do {
traverseNextOnLine();
@@ -130,7 +140,7 @@
return *this;
}
-BoxIterator& BoxIterator::traversePreviousOnLineIgnoringLineBreak()
+LeafBoxIterator& LeafBoxIterator::traversePreviousOnLineIgnoringLineBreak()
{
do {
traversePreviousOnLine();
@@ -138,7 +148,7 @@
return *this;
}
-BoxIterator& BoxIterator::traverseNextOnLineInLogicalOrder()
+LeafBoxIterator& LeafBoxIterator::traverseNextOnLineInLogicalOrder()
{
WTF::switchOn(m_box.m_pathVariant, [](auto& path) {
path.traverseNextOnLineInLogicalOrder();
@@ -146,7 +156,7 @@
return *this;
}
-BoxIterator& BoxIterator::traversePreviousOnLineInLogicalOrder()
+LeafBoxIterator& LeafBoxIterator::traversePreviousOnLineInLogicalOrder()
{
WTF::switchOn(m_box.m_pathVariant, [](auto& path) {
path.traversePreviousOnLineInLogicalOrder();
@@ -154,7 +164,7 @@
return *this;
}
-BoxIterator boxFor(const RenderLineBreak& renderer)
+LeafBoxIterator boxFor(const RenderLineBreak& renderer)
{
#if ENABLE(LAYOUT_FORMATTING_CONTEXT)
if (auto* lineLayout = LayoutIntegration::LineLayout::containing(renderer))
@@ -163,7 +173,7 @@
return { BoxLegacyPath(renderer.inlineBoxWrapper()) };
}
-BoxIterator boxFor(const RenderBox& renderer)
+LeafBoxIterator boxFor(const RenderBox& renderer)
{
#if ENABLE(LAYOUT_FORMATTING_CONTEXT)
if (auto* lineLayout = LayoutIntegration::LineLayout::containing(renderer))
@@ -173,7 +183,7 @@
}
#if ENABLE(LAYOUT_FORMATTING_CONTEXT)
-BoxIterator boxFor(const LayoutIntegration::InlineContent& content, size_t boxIndex)
+LeafBoxIterator boxFor(const LayoutIntegration::InlineContent& content, size_t boxIndex)
{
return { BoxModernPath { content, boxIndex } };
}
Modified: trunk/Source/WebCore/layout/integration/InlineIteratorBox.h (283546 => 283547)
--- trunk/Source/WebCore/layout/integration/InlineIteratorBox.h 2021-10-05 12:10:00 UTC (rev 283546)
+++ trunk/Source/WebCore/layout/integration/InlineIteratorBox.h 2021-10-05 13:54:20 UTC (rev 283547)
@@ -40,6 +40,7 @@
class LineIterator;
class BoxIterator;
+class LeafBoxIterator;
class TextBoxIterator;
struct EndIterator { };
@@ -90,15 +91,16 @@
const InlineDisplay::Box* inlineBox() const;
#endif
- BoxIterator nextOnLine() const;
- BoxIterator previousOnLine() const;
- BoxIterator nextOnLineIgnoringLineBreak() const;
- BoxIterator previousOnLineIgnoringLineBreak() const;
+ LeafBoxIterator nextOnLine() const;
+ LeafBoxIterator previousOnLine() const;
+ LeafBoxIterator nextOnLineIgnoringLineBreak() const;
+ LeafBoxIterator previousOnLineIgnoringLineBreak() const;
LineIterator line() const;
protected:
friend class BoxIterator;
+ friend class LeafBoxIterator;
friend class TextBoxIterator;
// To help with debugging.
@@ -112,10 +114,6 @@
class BoxIterator {
public:
- BoxIterator() : m_box(BoxLegacyPath { nullptr, { } }) { };
- BoxIterator(Box::PathVariant&&);
- BoxIterator(const Box&);
-
explicit operator bool() const { return !atEnd(); }
bool operator==(const BoxIterator&) const;
@@ -129,21 +127,32 @@
bool atEnd() const;
- BoxIterator& traverseNextOnLine();
- BoxIterator& traversePreviousOnLine();
- BoxIterator& traverseNextOnLineIgnoringLineBreak();
- BoxIterator& traversePreviousOnLineIgnoringLineBreak();
- BoxIterator& traverseNextOnLineInLogicalOrder();
- BoxIterator& traversePreviousOnLineInLogicalOrder();
+protected:
+ BoxIterator() : m_box(BoxLegacyPath { nullptr, { } }) { };
+ BoxIterator(Box::PathVariant&&);
+ BoxIterator(const Box&);
-protected:
Box m_box;
};
-BoxIterator boxFor(const RenderLineBreak&);
-BoxIterator boxFor(const RenderBox&);
+class LeafBoxIterator : public BoxIterator {
+public:
+ LeafBoxIterator() = default;
+ LeafBoxIterator(Box::PathVariant&&);
+ LeafBoxIterator(const Box&);
+
+ LeafBoxIterator& traverseNextOnLine();
+ LeafBoxIterator& traversePreviousOnLine();
+ LeafBoxIterator& traverseNextOnLineIgnoringLineBreak();
+ LeafBoxIterator& traversePreviousOnLineIgnoringLineBreak();
+ LeafBoxIterator& traverseNextOnLineInLogicalOrder();
+ LeafBoxIterator& traversePreviousOnLineInLogicalOrder();
+};
+
+LeafBoxIterator boxFor(const RenderLineBreak&);
+LeafBoxIterator boxFor(const RenderBox&);
#if ENABLE(LAYOUT_FORMATTING_CONTEXT)
-BoxIterator boxFor(const LayoutIntegration::InlineContent&, size_t boxIndex);
+LeafBoxIterator boxFor(const LayoutIntegration::InlineContent&, size_t boxIndex);
#endif
// -----------------------------------------------
Modified: trunk/Source/WebCore/layout/integration/InlineIteratorLine.cpp (283546 => 283547)
--- trunk/Source/WebCore/layout/integration/InlineIteratorLine.cpp 2021-10-05 12:10:00 UTC (rev 283546)
+++ trunk/Source/WebCore/layout/integration/InlineIteratorLine.cpp 2021-10-05 13:54:20 UTC (rev 283547)
@@ -101,35 +101,35 @@
return LineIterator(*this).traversePrevious();
}
-BoxIterator Line::firstRun() const
+LeafBoxIterator Line::firstRun() const
{
- return WTF::switchOn(m_pathVariant, [](auto& path) -> BoxIterator {
+ return WTF::switchOn(m_pathVariant, [](auto& path) -> LeafBoxIterator {
return { path.firstRun() };
});
}
-BoxIterator Line::lastRun() const
+LeafBoxIterator Line::lastRun() const
{
- return WTF::switchOn(m_pathVariant, [](auto& path) -> BoxIterator {
+ return WTF::switchOn(m_pathVariant, [](auto& path) -> LeafBoxIterator {
return { path.lastRun() };
});
}
-BoxIterator Line::logicalStartRun() const
+LeafBoxIterator Line::logicalStartRun() const
{
- return WTF::switchOn(m_pathVariant, [](auto& path) -> BoxIterator {
+ return WTF::switchOn(m_pathVariant, [](auto& path) -> LeafBoxIterator {
return { path.logicalStartRun() };
});
}
-BoxIterator Line::logicalEndRun() const
+LeafBoxIterator Line::logicalEndRun() const
{
- return WTF::switchOn(m_pathVariant, [](auto& path) -> BoxIterator {
+ return WTF::switchOn(m_pathVariant, [](auto& path) -> LeafBoxIterator {
return { path.logicalEndRun() };
});
}
-BoxIterator Line::logicalStartRunWithNode() const
+LeafBoxIterator Line::logicalStartRunWithNode() const
{
for (auto run = logicalStartRun(); run; run.traverseNextOnLineInLogicalOrder()) {
if (run->renderer().node())
@@ -138,7 +138,7 @@
return { };
}
-BoxIterator Line::logicalEndRunWithNode() const
+LeafBoxIterator Line::logicalEndRunWithNode() const
{
for (auto run = logicalEndRun(); run; run.traversePreviousOnLineInLogicalOrder()) {
if (run->renderer().node())
@@ -147,12 +147,12 @@
return { };
}
-BoxIterator Line::closestRunForPoint(const IntPoint& pointInContents, bool editableOnly) const
+LeafBoxIterator Line::closestRunForPoint(const IntPoint& pointInContents, bool editableOnly) const
{
return closestRunForLogicalLeftPosition(isHorizontal() ? pointInContents.x() : pointInContents.y(), editableOnly);
}
-BoxIterator Line::closestRunForLogicalLeftPosition(int leftPosition, bool editableOnly) const
+LeafBoxIterator Line::closestRunForLogicalLeftPosition(int leftPosition, bool editableOnly) const
{
auto isEditable = [&](auto run) {
return run && run->renderer().node() && run->renderer().node()->hasEditableStyle();
@@ -229,7 +229,7 @@
return state;
}
-BoxIterator Line::firstSelectedBox() const
+LeafBoxIterator Line::firstSelectedBox() const
{
for (auto box = firstRun(); box; box.traverseNextOnLine()) {
if (box->selectionState() != RenderObject::HighlightState::None)
@@ -238,7 +238,7 @@
return { };
}
-BoxIterator Line::lastSelectedBox() const
+LeafBoxIterator Line::lastSelectedBox() const
{
for (auto box = lastRun(); box; box.traversePreviousOnLine()) {
if (box->selectionState() != RenderObject::HighlightState::None)
Modified: trunk/Source/WebCore/layout/integration/InlineIteratorLine.h (283546 => 283547)
--- trunk/Source/WebCore/layout/integration/InlineIteratorLine.h 2021-10-05 12:10:00 UTC (rev 283546)
+++ trunk/Source/WebCore/layout/integration/InlineIteratorLine.h 2021-10-05 13:54:20 UTC (rev 283547)
@@ -35,7 +35,7 @@
class LineIterator;
class PathIterator;
-class BoxIterator;
+class LeafBoxIterator;
struct EndLineIterator { };
@@ -81,22 +81,22 @@
bool isFirst() const;
- BoxIterator firstRun() const;
- BoxIterator lastRun() const;
+ LeafBoxIterator firstRun() const;
+ LeafBoxIterator lastRun() const;
LineIterator next() const;
LineIterator previous() const;
- BoxIterator closestRunForPoint(const IntPoint& pointInContents, bool editableOnly) const;
- BoxIterator closestRunForLogicalLeftPosition(int position, bool editableOnly = false) const;
+ LeafBoxIterator closestRunForPoint(const IntPoint& pointInContents, bool editableOnly) const;
+ LeafBoxIterator closestRunForLogicalLeftPosition(int position, bool editableOnly = false) const;
- BoxIterator logicalStartRun() const;
- BoxIterator logicalEndRun() const;
- BoxIterator logicalStartRunWithNode() const;
- BoxIterator logicalEndRunWithNode() const;
+ LeafBoxIterator logicalStartRun() const;
+ LeafBoxIterator logicalEndRun() const;
+ LeafBoxIterator logicalStartRunWithNode() const;
+ LeafBoxIterator logicalEndRunWithNode() const;
- BoxIterator firstSelectedBox() const;
- BoxIterator lastSelectedBox() const;
+ LeafBoxIterator firstSelectedBox() const;
+ LeafBoxIterator lastSelectedBox() const;
private:
friend class LineIterator;
Modified: trunk/Source/WebCore/layout/integration/InlineIteratorTextBox.cpp (283546 => 283547)
--- trunk/Source/WebCore/layout/integration/InlineIteratorTextBox.cpp 2021-10-05 12:10:00 UTC (rev 283546)
+++ trunk/Source/WebCore/layout/integration/InlineIteratorTextBox.cpp 2021-10-05 13:54:20 UTC (rev 283547)
@@ -77,12 +77,12 @@
}
TextBoxIterator::TextBoxIterator(Box::PathVariant&& pathVariant)
- : BoxIterator(WTFMove(pathVariant))
+ : LeafBoxIterator(WTFMove(pathVariant))
{
}
TextBoxIterator::TextBoxIterator(const Box& box)
- : BoxIterator(box)
+ : LeafBoxIterator(box)
{
}
Modified: trunk/Source/WebCore/layout/integration/InlineIteratorTextBox.h (283546 => 283547)
--- trunk/Source/WebCore/layout/integration/InlineIteratorTextBox.h 2021-10-05 12:10:00 UTC (rev 283546)
+++ trunk/Source/WebCore/layout/integration/InlineIteratorTextBox.h 2021-10-05 13:54:20 UTC (rev 283547)
@@ -63,7 +63,7 @@
TextBoxIterator nextTextBoxInTextOrder() const;
};
-class TextBoxIterator : public BoxIterator {
+class TextBoxIterator : public LeafBoxIterator {
public:
TextBoxIterator() { }
TextBoxIterator(Box::PathVariant&&);
Modified: trunk/Source/WebCore/layout/integration/LayoutIntegrationLineLayout.cpp (283546 => 283547)
--- trunk/Source/WebCore/layout/integration/LayoutIntegrationLineLayout.cpp 2021-10-05 12:10:00 UTC (rev 283546)
+++ trunk/Source/WebCore/layout/integration/LayoutIntegrationLineLayout.cpp 2021-10-05 13:54:20 UTC (rev 283547)
@@ -404,7 +404,7 @@
return InlineIterator::textBoxFor(*m_inlineContent, *firstIndex);
}
-InlineIterator::BoxIterator LineLayout::boxFor(const RenderElement& renderElement) const
+InlineIterator::LeafBoxIterator LineLayout::boxFor(const RenderElement& renderElement) const
{
if (!m_inlineContent)
return { };
Modified: trunk/Source/WebCore/layout/integration/LayoutIntegrationLineLayout.h (283546 => 283547)
--- trunk/Source/WebCore/layout/integration/LayoutIntegrationLineLayout.h 2021-10-05 12:10:00 UTC (rev 283546)
+++ trunk/Source/WebCore/layout/integration/LayoutIntegrationLineLayout.h 2021-10-05 13:54:20 UTC (rev 283547)
@@ -97,7 +97,7 @@
bool hitTest(const HitTestRequest&, HitTestResult&, const HitTestLocation&, const LayoutPoint& accumulatedOffset, HitTestAction);
InlineIterator::TextBoxIterator textBoxesFor(const RenderText&) const;
- InlineIterator::BoxIterator boxFor(const RenderElement&) const;
+ InlineIterator::LeafBoxIterator boxFor(const RenderElement&) const;
InlineIterator::LineIterator firstLine() const;
InlineIterator::LineIterator lastLine() const;
Modified: trunk/Source/WebCore/rendering/RenderBlockFlow.cpp (283546 => 283547)
--- trunk/Source/WebCore/rendering/RenderBlockFlow.cpp 2021-10-05 12:10:00 UTC (rev 283546)
+++ trunk/Source/WebCore/rendering/RenderBlockFlow.cpp 2021-10-05 13:54:20 UTC (rev 283547)
@@ -3550,7 +3550,7 @@
bool blocksAreFlipped = style().isFlippedBlocksWritingMode();
// look for the closest line box in the root box which is at the passed-in y coordinate
- InlineIterator::BoxIterator closestRun;
+ InlineIterator::LeafBoxIterator closestRun;
InlineIterator::LineIterator firstLineWithChildren;
InlineIterator::LineIterator lastLineWithChildren;
for (auto line = firstLine; line; line.traverseNext()) {