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

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

Issue 1320543003: Simplify RenderedPosition constructor with VisiblePosition parameter (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: 2015-08-27T16:44:57 Created 5 years, 4 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/editing/RenderedPosition.cpp
diff --git a/Source/core/editing/RenderedPosition.cpp b/Source/core/editing/RenderedPosition.cpp
index 098514c98aa82d090fda7a6d8f599a25df8278f6..8603d5f9c341bbbfc9ddf8ba30fe97131b80ec72 100644
--- a/Source/core/editing/RenderedPosition.cpp
+++ b/Source/core/editing/RenderedPosition.cpp
@@ -67,21 +67,8 @@ static inline LayoutObject* layoutObjectFromPosition(const Position& position)
}
RenderedPosition::RenderedPosition(const VisiblePosition& position)
- : m_layoutObject(nullptr)
- , m_inlineBox(nullptr)
- , m_offset(0)
- , m_prevLeafChild(uncachedInlineBox())
- , m_nextLeafChild(uncachedInlineBox())
+ : RenderedPosition(position.deepEquivalent(), position.affinity())
{
- if (position.isNull())
- return;
- InlineBoxPosition boxPosition = computeInlineBoxPosition(position);
- m_inlineBox = boxPosition.inlineBox;
- m_offset = boxPosition.offsetInBox;
- if (m_inlineBox)
- m_layoutObject = &m_inlineBox->layoutObject();
- else
- m_layoutObject = layoutObjectFromPosition(position.deepEquivalent());
}
RenderedPosition::RenderedPosition(const Position& position, TextAffinity affinity)
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698