Chromium Code Reviews| Index: third_party/WebKit/Source/core/editing/iterators/TextIterator.cpp |
| diff --git a/third_party/WebKit/Source/core/editing/iterators/TextIterator.cpp b/third_party/WebKit/Source/core/editing/iterators/TextIterator.cpp |
| index 3b826f4d6726e0e66f6882d1eab84d643858d1dd..dea79095774dcdfcd9e86c2c969ec6ec5e711da6 100644 |
| --- a/third_party/WebKit/Source/core/editing/iterators/TextIterator.cpp |
| +++ b/third_party/WebKit/Source/core/editing/iterators/TextIterator.cpp |
| @@ -147,6 +147,13 @@ int shadowDepthOf<EditingInFlatTreeStrategy>(const Node& startContainer, |
| return 0; |
| } |
| +bool isRenderedAsTable(const Node* node) { |
| + if (!node || !node->isElementNode()) |
| + return false; |
| + LayoutObject* layoutObject = node->layoutObject(); |
| + return (layoutObject && layoutObject->isTable()); |
|
yosin_UTC9
2017/03/16 08:57:33
nit: Please omit surrounding parenthesis.
tkent
2017/03/16 09:02:50
Done.
|
| +} |
| + |
| } // namespace |
| template <typename Strategy> |
| @@ -1037,8 +1044,7 @@ static bool shouldEmitExtraNewlineForNode(Node* node) { |
| // container) or as we hit it (if it's atomic). |
| template <typename Strategy> |
| bool TextIteratorAlgorithm<Strategy>::shouldRepresentNodeOffsetZero() { |
| - if (emitsCharactersBetweenAllVisiblePositions() && |
| - isDisplayInsideTable(m_node)) |
| + if (emitsCharactersBetweenAllVisiblePositions() && isRenderedAsTable(m_node)) |
| return true; |
| // Leave element positioned flush with start of a paragraph |
| @@ -1107,7 +1113,7 @@ bool TextIteratorAlgorithm<Strategy>::shouldRepresentNodeOffsetZero() { |
| template <typename Strategy> |
| bool TextIteratorAlgorithm<Strategy>::shouldEmitSpaceBeforeAndAfterNode( |
| Node* node) { |
| - return isDisplayInsideTable(node) && |
| + return isRenderedAsTable(node) && |
| (node->layoutObject()->isInline() || |
| emitsCharactersBetweenAllVisiblePositions()); |
| } |