1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include "content/renderer/dom_utils.h"
7 #include "third_party/WebKit/public/web/WebNode.h"
11 blink::WebNode
DomUtils::ExtractParentAnchorNode(
12 const blink::WebNode
& node
) {
13 blink::WebNode selected_node
= node
;
15 // If there are other embedded tags (like <a ..>Some <b>text</b></a>)
16 // we need to extract the parent <a/> node.
17 while (!selected_node
.isNull() && !selected_node
.isLink())
18 selected_node
= selected_node
.parentNode();
22 } // namespace content