| Index: Source/core/dom/shadow/ComposedTreeTraversal.cpp
|
| diff --git a/Source/core/dom/shadow/ComposedTreeTraversal.cpp b/Source/core/dom/shadow/ComposedTreeTraversal.cpp
|
| index 8966b8faf5431cd71aa70284474b6687d23da9be..37d7b68f0ffd93652da801a5fd89af2f6543bea6 100644
|
| --- a/Source/core/dom/shadow/ComposedTreeTraversal.cpp
|
| +++ b/Source/core/dom/shadow/ComposedTreeTraversal.cpp
|
| @@ -241,4 +241,23 @@ unsigned ComposedTreeTraversal::countChildren(const Node& node)
|
| return count;
|
| }
|
|
|
| +Node* ComposedTreeTraversal::lastWithin(const Node& node)
|
| +{
|
| + assertPrecondition(node);
|
| + Node* descendant = traverseLastChild(node);
|
| + for (Node* child = descendant; child; child = lastChild(*child))
|
| + descendant = child;
|
| + assertPostcondition(descendant);
|
| + return descendant;
|
| +}
|
| +
|
| +Node& ComposedTreeTraversal::lastWithinOrSelf(const Node& node)
|
| +{
|
| + assertPrecondition(node);
|
| + Node* lastDescendant = lastWithin(node);
|
| + Node& result = lastDescendant ? *lastDescendant : const_cast<Node&>(node);
|
| + assertPostcondition(&result);
|
| + return result;
|
| +}
|
| +
|
| } // namespace
|
|
|