Chromium Code Reviews| Index: Source/core/editing/EditingUtilities.cpp |
| diff --git a/Source/core/editing/EditingUtilities.cpp b/Source/core/editing/EditingUtilities.cpp |
| index 24dc578225bebd0fab33b54f51ab60d72ce62135..7fb23323f16c7397a244d06adc844a0f862c168a 100644 |
| --- a/Source/core/editing/EditingUtilities.cpp |
| +++ b/Source/core/editing/EditingUtilities.cpp |
| @@ -693,15 +693,26 @@ bool nodeIsUserSelectNone(Node* node) |
| return node && node->layoutObject() && !node->layoutObject()->isSelectable(); |
| } |
| -TextDirection directionOfEnclosingBlock(const Position& position) |
| +template <typename Strategy> |
| +TextDirection directionOfEnclosingBlockAlgorithm(const PositionAlgorithm<Strategy>& position) |
| { |
| - Element* enclosingBlockElement = enclosingBlock(position.computeContainerNode()); |
| + Element* enclosingBlockElement = enclosingBlock(position, CannotCrossEditingBoundary); |
|
yoichio
2015/08/28 02:26:17
This replacement means
|firstPositionInOrBeforeNo
yosin_UTC9
2015/08/28 05:45:11
No, we should pass Position(position.computeContai
|
| if (!enclosingBlockElement) |
| return LTR; |
| LayoutObject* layoutObject = enclosingBlockElement->layoutObject(); |
| return layoutObject ? layoutObject->style()->direction() : LTR; |
| } |
| +TextDirection directionOfEnclosingBlock(const Position& position) |
| +{ |
| + return directionOfEnclosingBlockAlgorithm<EditingStrategy>(position); |
| +} |
| + |
| +TextDirection directionOfEnclosingBlock(const PositionInComposedTree& position) |
| +{ |
| + return directionOfEnclosingBlockAlgorithm<EditingInComposedTreeStrategy>(position); |
| +} |
| + |
| TextDirection primaryDirectionOf(const Node& node) |
| { |
| TextDirection primaryDirection = LTR; |