Chromium Code Reviews| Index: Source/core/dom/PositionIterator.cpp |
| diff --git a/Source/core/dom/PositionIterator.cpp b/Source/core/dom/PositionIterator.cpp |
| index 5cc76b10806b1aa7cfbe0da0200b9766bb96b019..6427a2d2ee68752473d5d1fa62e440ddaf495ceb 100644 |
| --- a/Source/core/dom/PositionIterator.cpp |
| +++ b/Source/core/dom/PositionIterator.cpp |
| @@ -31,6 +31,7 @@ |
| #include "core/editing/htmlediting.h" |
| #include "core/html/HTMLHtmlElement.h" |
| #include "core/rendering/RenderBlock.h" |
| +#include "core/rendering/RenderTextFragment.h" |
| namespace WebCore { |
| @@ -103,6 +104,14 @@ void PositionIterator::decrement() |
| } |
| } |
| +RenderObject* PositionIterator::renderer() const |
|
ojan
2013/09/23 23:01:45
This is confusing since it's only the renderer of
|
| +{ |
| + if (!m_anchorNode) |
|
ojan
2013/09/23 23:01:45
This null check is redundant with the one in Posit
|
| + return 0; |
| + Position pos = *this; |
| + return pos.rendererOfAnchorNode(); |
| +} |
| + |
| bool PositionIterator::atStart() const |
| { |
| if (!m_anchorNode) |
| @@ -144,7 +153,7 @@ bool PositionIterator::isCandidate() const |
| if (!m_anchorNode) |
| return false; |
| - RenderObject* renderer = m_anchorNode->renderer(); |
| + RenderObject* renderer = this->renderer(); |
| if (!renderer) |
| return false; |