Commit b585166f authored by yosin@chromium.org's avatar yosin@chromium.org

Simplify RenderedPosition constructor with VisiblePosition parameter

This patch makes |RenderedPosition| constructor with |VisiblePosition|
parameter simpler by using delegating constructor for improving code helath.

This patch is a preparation of making selection to handle granularity for web
component, http://crrev.com/1277863002

BUG=513568
TEST=n/a; No behavior changes

Review URL: https://codereview.chromium.org/1320543003

git-svn-id: svn://svn.chromium.org/blink/trunk@201300 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent 89f08037
......@@ -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)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment