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

Unified Diff: Source/core/rendering/RenderListMarker.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/rendering/RenderListMarker.cpp
diff --git a/Source/core/rendering/RenderListMarker.cpp b/Source/core/rendering/RenderListMarker.cpp
index 38664a289f4296a83193b2eed0dc61b8be324997..fe936092b3cd8bea91adf3c18e7641d54bfbde9a 100644
--- a/Source/core/rendering/RenderListMarker.cpp
+++ b/Source/core/rendering/RenderListMarker.cpp
@@ -1116,11 +1116,11 @@ LayoutRect RenderListMarker::localSelectionRect()
InlineBox* box = inlineBoxWrapper();
if (!box)
return LayoutRect(LayoutPoint(), size());
- RootInlineBox* root = inlineBoxWrapper()->root();
- LayoutUnit newLogicalTop = root->block().style()->isFlippedBlocksWritingMode() ? inlineBoxWrapper()->logicalBottom() - root->selectionBottom() : root->selectionTop() - inlineBoxWrapper()->logicalTop();
- if (root->block().style()->isHorizontalWritingMode())
- return LayoutRect(0, newLogicalTop, width(), root->selectionHeight());
- return LayoutRect(newLogicalTop, 0, root->selectionHeight(), height());
+ RootInlineBox& root = inlineBoxWrapper()->root();
+ LayoutUnit newLogicalTop = root.block().style()->isFlippedBlocksWritingMode() ? inlineBoxWrapper()->logicalBottom() - root.selectionBottom() : root.selectionTop() - inlineBoxWrapper()->logicalTop();
+ if (root.block().style()->isHorizontalWritingMode())
+ return LayoutRect(0, newLogicalTop, width(), root.selectionHeight());
+ return LayoutRect(newLogicalTop, 0, root.selectionHeight(), height());
}
void RenderListMarker::paint(PaintInfo& paintInfo, const LayoutPoint& paintOffset)
@@ -1825,8 +1825,7 @@ void RenderListMarker::setSelectionState(SelectionState state)
RenderBox::setSelectionState(state);
if (inlineBoxWrapper() && canUpdateSelectionOnRootLineBoxes())
- if (RootInlineBox* root = inlineBoxWrapper()->root())
- root->setHasSelectedChildren(state != SelectionNone);
+ inlineBoxWrapper()->root().setHasSelectedChildren(state != SelectionNone);
}
LayoutRect RenderListMarker::selectionRectForRepaint(const RenderLayerModelObject* repaintContainer, bool clipToVisibleContent)
@@ -1836,8 +1835,8 @@ LayoutRect RenderListMarker::selectionRectForRepaint(const RenderLayerModelObjec
if (selectionState() == SelectionNone || !inlineBoxWrapper())
return LayoutRect();
- RootInlineBox* root = inlineBoxWrapper()->root();
- LayoutRect rect(0, root->selectionTop() - y(), width(), root->selectionHeight());
+ RootInlineBox& root = inlineBoxWrapper()->root();
+ LayoutRect rect(0, root.selectionTop() - y(), width(), root.selectionHeight());
if (clipToVisibleContent)
computeRectForRepaint(repaintContainer, rect);

Powered by Google App Engine
This is Rietveld 408576698