Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(64)

Unified Diff: content/renderer/dom_serializer_browsertest.cc

Issue 149913011: Update content/renderer code to use WebElementCollection instead of WebNodeCollection (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | content/renderer/savable_resources.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/dom_serializer_browsertest.cc
diff --git a/content/renderer/dom_serializer_browsertest.cc b/content/renderer/dom_serializer_browsertest.cc
index bbe89cbaa8a30d5096d4c2e0e9548387c2b05a28..f3861b26fb54aefbe418cb1cfb048c1ff03a8da6 100644
--- a/content/renderer/dom_serializer_browsertest.cc
+++ b/content/renderer/dom_serializer_browsertest.cc
@@ -27,9 +27,9 @@
#include "third_party/WebKit/public/platform/WebVector.h"
#include "third_party/WebKit/public/web/WebDocument.h"
#include "third_party/WebKit/public/web/WebElement.h"
+#include "third_party/WebKit/public/web/WebElementCollection.h"
#include "third_party/WebKit/public/web/WebFrame.h"
#include "third_party/WebKit/public/web/WebNode.h"
-#include "third_party/WebKit/public/web/WebNodeCollection.h"
#include "third_party/WebKit/public/web/WebNodeList.h"
#include "third_party/WebKit/public/web/WebPageSerializer.h"
#include "third_party/WebKit/public/web/WebPageSerializerClient.h"
@@ -39,13 +39,12 @@ using blink::WebCString;
using blink::WebData;
using blink::WebDocument;
using blink::WebElement;
+using blink::WebElementCollection;
using blink::WebFrame;
using blink::WebNode;
-using blink::WebNodeCollection;
using blink::WebNodeList;
using blink::WebPageSerializer;
using blink::WebPageSerializerClient;
-using blink::WebNode;
using blink::WebString;
using blink::WebURL;
using blink::WebView;
@@ -73,13 +72,10 @@ WebFrame* FindSubFrameByURL(WebView* web_view, const GURL& url) {
stack.pop_back();
if (GURL(current_frame->document().url()) == url)
return current_frame;
- WebNodeCollection all = current_frame->document().all();
- for (WebNode node = all.firstItem();
- !node.isNull(); node = all.nextItem()) {
- if (!node.isElementNode())
- continue;
+ WebElementCollection all = current_frame->document().all();
+ for (WebElement element = all.firstItem();
+ !element.isNull(); element = all.nextItem()) {
// Check frame tag and iframe tag
- WebElement element = node.to<WebElement>();
if (!element.hasTagName("frame") && !element.hasTagName("iframe"))
continue;
WebFrame* sub_frame = WebFrame::fromFrameOwnerElement(element);
@@ -614,13 +610,10 @@ class DomSerializerTests : public ContentBrowserTest,
WebDocument doc = web_frame->document();
ASSERT_TRUE(doc.isHTMLDocument());
// Go through all descent nodes.
- WebNodeCollection all = doc.all();
+ WebElementCollection all = doc.all();
int original_base_tag_count = 0;
- for (WebNode node = all.firstItem(); !node.isNull();
- node = all.nextItem()) {
- if (!node.isElementNode())
- continue;
- WebElement element = node.to<WebElement>();
+ for (WebElement element = all.firstItem(); !element.isNull();
+ element = all.nextItem()) {
if (element.hasTagName("base")) {
original_base_tag_count++;
} else {
« no previous file with comments | « no previous file | content/renderer/savable_resources.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698