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..10e9586950e1d05fd1d47f36e3fcf9a4bd09b1c0 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()); |
|
yoichio
2015/08/28 05:55:23
enclosingBlock has DOM/InComposition overrides so
yosin_UTC9
2015/08/28 06:22:58
PS#1 does |enclosingBlock(position)|, however as y
|
| + Element* enclosingBlockElement = enclosingBlock(PositionAlgorithm<Strategy>::firstPositionInOrBeforeNode(position.computeContainerNode()), CannotCrossEditingBoundary); |
| 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; |