Upstream version 5.34.104.0
[platform/framework/web/crosswalk.git] / src / chrome / renderer / safe_browsing / malware_dom_details.cc
index 605ab69..3e83261 100644 (file)
@@ -11,8 +11,8 @@
 #include "third_party/WebKit/public/platform/WebString.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/WebNodeCollection.h"
 #include "third_party/WebKit/public/web/WebView.h"
 
 namespace safe_browsing {
@@ -71,13 +71,9 @@ void MalwareDOMDetails::ExtractResources(
       continue;
     }
 
-    blink::WebNodeCollection elements = document.all();
-    blink::WebNode cur_node = elements.firstItem();
-    for (; !cur_node.isNull(); cur_node = elements.nextItem()) {
-      if (!cur_node.isElementNode()) {
-        continue;
-      }
-      blink::WebElement element = cur_node.to<blink::WebElement>();
+    blink::WebElementCollection elements = document.all();
+    blink::WebElement element = elements.firstItem();
+    for (; !element.isNull(); element = elements.nextItem()) {
       if (element.hasTagName("iframe") || element.hasTagName("frame") ||
           element.hasTagName("embed") || element.hasTagName("script")) {
         HandleElement(element, &details_node, resources);