| Index: third_party/WebKit/Source/core/dom/Node.cpp
|
| diff --git a/third_party/WebKit/Source/core/dom/Node.cpp b/third_party/WebKit/Source/core/dom/Node.cpp
|
| index 84a8cea65e1140ef19992d5e3c884b1fd0ce5c1f..d830fe984f09eb70e76808d7a3fd42efeaf11a13 100644
|
| --- a/third_party/WebKit/Source/core/dom/Node.cpp
|
| +++ b/third_party/WebKit/Source/core/dom/Node.cpp
|
| @@ -1107,29 +1107,32 @@ ContainerNode* Node::parentOrShadowHostOrTemplateHostNode() const
|
| return parentOrShadowHostNode();
|
| }
|
|
|
| -bool Node::isRootEditableElement() const
|
| +// TODO(yoichio): Move to core/editing
|
| +bool isRootEditableElement(const Node& node)
|
| {
|
| - return hasEditableStyle() && isElementNode() && (!parentNode() || !parentNode()->hasEditableStyle()
|
| - || !parentNode()->isElementNode() || this == document().body());
|
| + return node.hasEditableStyle() && node.isElementNode() && (!node.parentNode() || !node.parentNode()->hasEditableStyle()
|
| + || !node.parentNode()->isElementNode() || &node == node.document().body());
|
| }
|
|
|
| -Element* Node::rootEditableElement(EditableType editableType) const
|
| +// TODO(yoichio): Move to core/editing
|
| +Element* rootEditableElement(const Node& node, EditableType editableType)
|
| {
|
| if (editableType == HasEditableAXRole) {
|
| - if (AXObjectCache* cache = document().existingAXObjectCache())
|
| - return const_cast<Element*>(cache->rootAXEditableElement(this));
|
| + if (AXObjectCache* cache = node.document().existingAXObjectCache())
|
| + return const_cast<Element*>(cache->rootAXEditableElement(&node));
|
| }
|
|
|
| - return rootEditableElement();
|
| + return rootEditableElement(node);
|
| }
|
|
|
| -Element* Node::rootEditableElement() const
|
| +// TODO(yoichio): Move to core/editing
|
| +Element* rootEditableElement(const Node& node)
|
| {
|
| const Node* result = nullptr;
|
| - for (const Node* n = this; n && n->hasEditableStyle(); n = n->parentNode()) {
|
| + for (const Node* n = &node; n && n->hasEditableStyle(); n = n->parentNode()) {
|
| if (n->isElementNode())
|
| result = n;
|
| - if (document().body() == n)
|
| + if (node.document().body() == n)
|
| break;
|
| }
|
| return toElement(const_cast<Node*>(result));
|
|
|