| Index: content/renderer/context_menu_params_builder.cc
|
| diff --git a/content/renderer/context_menu_params_builder.cc b/content/renderer/context_menu_params_builder.cc
|
| index 7cd34beb46476c69e2ae3a4e8203745954f3ae92..0d53dac225eefaf56f29cb59b620a63e389a09c6 100644
|
| --- a/content/renderer/context_menu_params_builder.cc
|
| +++ b/content/renderer/context_menu_params_builder.cc
|
| @@ -7,6 +7,7 @@
|
| #include "base/logging.h"
|
| #include "content/common/ssl_status_serialization.h"
|
| #include "content/public/common/context_menu_params.h"
|
| +#include "content/renderer/dom_utils.h"
|
| #include "content/renderer/history_serialization.h"
|
| #include "content/renderer/menu_item_builder.h"
|
| #include "third_party/WebKit/public/web/WebElement.h"
|
| @@ -55,14 +56,7 @@ ContextMenuParams ContextMenuParamsBuilder::Build(
|
| }
|
|
|
| if (!params.link_url.is_empty()) {
|
| - blink::WebNode selectedNode = data.node;
|
| -
|
| - // If there are other embedded tags (like <a ..>Some <b>text</b></a>)
|
| - // we need to extract the parent <a/> node.
|
| - while (!selectedNode.isLink() && !selectedNode.parentNode().isNull()) {
|
| - selectedNode = selectedNode.parentNode();
|
| - }
|
| -
|
| + blink::WebNode selectedNode = DomUtils::ExtractParentAnchorNode(data.node);
|
| blink::WebElement selectedElement = selectedNode.to<blink::WebElement>();
|
| if (selectedNode.isLink() && !selectedElement.isNull()) {
|
| params.link_text = selectedElement.innerText();
|
|
|