OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2009 Google Inc. All rights reserved. | 2 * Copyright (C) 2009 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
158 return; | 158 return; |
159 | 159 |
160 // If we have already seen that frame, ignore it. | 160 // If we have already seen that frame, ignore it. |
161 if (visitedFrames->contains(frame)) | 161 if (visitedFrames->contains(frame)) |
162 return; | 162 return; |
163 visitedFrames->append(frame); | 163 visitedFrames->append(frame); |
164 if (!frameURLs->contains(frameURL)) | 164 if (!frameURLs->contains(frameURL)) |
165 frameURLs->append(frameURL); | 165 frameURLs->append(frameURL); |
166 | 166 |
167 // Now get the resources associated with each node of the document. | 167 // Now get the resources associated with each node of the document. |
168 RefPtr<HTMLCollection> allNodes = frame->document()->all(); | 168 RefPtr<HTMLCollection> allElements = frame->document()->all(); |
169 for (unsigned i = 0; i < allNodes->length(); ++i) { | 169 for (unsigned i = 0; i < allElements->length(); ++i) { |
170 Node* node = allNodes->item(i); | 170 Element* element = allElements->item(i); |
171 // We are only interested in HTML resources. | 171 retrieveResourcesForElement(element, |
172 if (!node->isElementNode()) | |
173 continue; | |
174 retrieveResourcesForElement(toElement(node), | |
175 visitedFrames, framesToVisit, | 172 visitedFrames, framesToVisit, |
176 frameURLs, resourceURLs); | 173 frameURLs, resourceURLs); |
177 } | 174 } |
178 } | 175 } |
179 | 176 |
180 } // namespace | 177 } // namespace |
181 | 178 |
182 namespace blink { | 179 namespace blink { |
183 | 180 |
184 void WebPageSerializer::serialize(WebView* view, WebVector<WebPageSerializer::Re
source>* resourcesParam) | 181 void WebPageSerializer::serialize(WebView* view, WebVector<WebPageSerializer::Re
source>* resourcesParam) |
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
292 | 289 |
293 WebString WebPageSerializer::generateBaseTagDeclaration(const WebString& baseTar
get) | 290 WebString WebPageSerializer::generateBaseTagDeclaration(const WebString& baseTar
get) |
294 { | 291 { |
295 if (baseTarget.isEmpty()) | 292 if (baseTarget.isEmpty()) |
296 return String("<base href=\".\">"); | 293 return String("<base href=\".\">"); |
297 String baseString = "<base href=\".\" target=\"" + static_cast<const String&
>(baseTarget) + "\">"; | 294 String baseString = "<base href=\".\" target=\"" + static_cast<const String&
>(baseTarget) + "\">"; |
298 return baseString; | 295 return baseString; |
299 } | 296 } |
300 | 297 |
301 } // namespace blink | 298 } // namespace blink |
OLD | NEW |