Index: Source/core/editing/EditingUtilities.cpp |
diff --git a/Source/core/editing/EditingUtilities.cpp b/Source/core/editing/EditingUtilities.cpp |
index 3f77c55442fdec4f8213018f66ab2777f843384c..48881234e34683800878fa2cf55acccdb475cefc 100644 |
--- a/Source/core/editing/EditingUtilities.cpp |
+++ b/Source/core/editing/EditingUtilities.cpp |
@@ -661,12 +661,23 @@ Element* enclosingBlock(Node* node, EditingBoundaryCrossingRule rule) |
return enclosingBlock(firstPositionInOrBeforeNode(node), rule); |
} |
-Element* enclosingBlock(const Position& position, EditingBoundaryCrossingRule rule) |
+template <typename Strategy> |
+Element* enclosingBlockAlgorithm(const PositionAlgorithm<Strategy>& position, EditingBoundaryCrossingRule rule) |
{ |
Node* enclosingNode = enclosingNodeOfType(position, isEnclosingBlock, rule); |
return enclosingNode && enclosingNode->isElementNode() ? toElement(enclosingNode) : nullptr; |
} |
+Element* enclosingBlock(const Position& position, EditingBoundaryCrossingRule rule) |
+{ |
+ return enclosingBlockAlgorithm<EditingStrategy>(position, rule); |
+} |
+ |
+Element* enclosingBlock(const PositionInComposedTree& position, EditingBoundaryCrossingRule rule) |
+{ |
+ return enclosingBlockAlgorithm<EditingInComposedTreeStrategy>(position, rule); |
+} |
+ |
Element* enclosingBlockFlowElement(Node& node) |
{ |
if (isBlockFlowElement(node)) |