Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(724)

Unified Diff: Source/core/editing/VisibleUnits.cpp

Issue 182413005: Return refererence from InlineBox::root() (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: re-upload because previous patch didn't upload correctly. Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: Source/core/editing/VisibleUnits.cpp
diff --git a/Source/core/editing/VisibleUnits.cpp b/Source/core/editing/VisibleUnits.cpp
index 1068c8cacefc50523d243891b7de309dca591c9e..8214b42adfb3e9bfbbf0b42e3721e9bc5bba7bcf 100644
--- a/Source/core/editing/VisibleUnits.cpp
+++ b/Source/core/editing/VisibleUnits.cpp
@@ -207,11 +207,11 @@ static const InlineTextBox* logicallyPreviousBox(const VisiblePosition& visibleP
{
const InlineBox* startBox = textBox;
- const InlineTextBox* previousBox = leafBoxes.previousTextBox(startBox->root(), textBox);
+ const InlineTextBox* previousBox = leafBoxes.previousTextBox(&startBox->root(), textBox);
if (previousBox)
return previousBox;
- previousBox = leafBoxes.previousTextBox(startBox->root()->prevRootBox(), 0);
+ previousBox = leafBoxes.previousTextBox(startBox->root().prevRootBox(), 0);
if (previousBox)
return previousBox;
@@ -248,11 +248,11 @@ static const InlineTextBox* logicallyNextBox(const VisiblePosition& visiblePosit
{
const InlineBox* startBox = textBox;
- const InlineTextBox* nextBox = leafBoxes.nextTextBox(startBox->root(), textBox);
+ const InlineTextBox* nextBox = leafBoxes.nextTextBox(&startBox->root(), textBox);
if (nextBox)
return nextBox;
- nextBox = leafBoxes.nextTextBox(startBox->root()->nextRootBox(), 0);
+ nextBox = leafBoxes.nextTextBox(startBox->root().nextRootBox(), 0);
if (nextBox)
return nextBox;
@@ -929,7 +929,7 @@ VisiblePosition previousLinePosition(const VisiblePosition &visiblePosition, int
int ignoredCaretOffset;
visiblePosition.getInlineBoxAndOffset(box, ignoredCaretOffset);
if (box) {
- root = box->root()->prevRootBox();
+ 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())
@@ -984,7 +984,7 @@ VisiblePosition nextLinePosition(const VisiblePosition &visiblePosition, int lin
int ignoredCaretOffset;
visiblePosition.getInlineBoxAndOffset(box, ignoredCaretOffset);
if (box) {
- root = box->root()->nextRootBox();
+ 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())

Powered by Google App Engine
This is Rietveld 408576698