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

Side by Side Diff: Source/core/page/PageSerializer.cpp

Issue 1172303002: Merge page serializers [9/12] (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rename text.txt to empty.txt Created 5 years, 6 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2011 Google Inc. All rights reserved. 2 * Copyright (C) 2011 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 231 matching lines...) Expand 10 before | Expand all | Expand 10 after
242 m_resources->append(SerializedResource(url, document.suggestedMIMEType(), Sh aredBuffer::create(frameHTML.data(), frameHTML.length()))); 242 m_resources->append(SerializedResource(url, document.suggestedMIMEType(), Sh aredBuffer::create(frameHTML.data(), frameHTML.length())));
243 m_resourceURLs.add(url); 243 m_resourceURLs.add(url);
244 244
245 for (Node* node: serializedNodes) { 245 for (Node* node: serializedNodes) {
246 ASSERT(node); 246 ASSERT(node);
247 if (!node->isElementNode()) 247 if (!node->isElementNode())
248 continue; 248 continue;
249 249
250 Element& element = toElement(*node); 250 Element& element = toElement(*node);
251 // We have to process in-line style as it might contain some resources ( typically background images). 251 // We have to process in-line style as it might contain some resources ( typically background images).
252 if (element.isStyledElement()) 252 if (element.isStyledElement()) {
253 retrieveResourcesForProperties(element.inlineStyle(), document); 253 retrieveResourcesForProperties(element.inlineStyle(), document);
254 retrieveResourcesForProperties(element.presentationAttributeStyle(), document);
255 }
254 256
255 if (isHTMLImageElement(element)) { 257 if (isHTMLImageElement(element)) {
256 HTMLImageElement& imageElement = toHTMLImageElement(element); 258 HTMLImageElement& imageElement = toHTMLImageElement(element);
257 KURL url = document.completeURL(imageElement.getAttribute(HTMLNames: :srcAttr)); 259 KURL url = document.completeURL(imageElement.getAttribute(HTMLNames: :srcAttr));
258 ImageResource* cachedImage = imageElement.cachedImage(); 260 ImageResource* cachedImage = imageElement.cachedImage();
259 addImageToResources(cachedImage, imageElement.layoutObject(), url); 261 addImageToResources(cachedImage, imageElement.layoutObject(), url);
260 } else if (isHTMLInputElement(element)) { 262 } else if (isHTMLInputElement(element)) {
261 HTMLInputElement& inputElement = toHTMLInputElement(element); 263 HTMLInputElement& inputElement = toHTMLInputElement(element);
262 if (inputElement.type() == InputTypeNames::image && inputElement.ima geLoader()) { 264 if (inputElement.type() == InputTypeNames::image && inputElement.ima geLoader()) {
263 KURL url = inputElement.src(); 265 KURL url = inputElement.src();
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after
416 418
417 return fakeURL; 419 return fakeURL;
418 } 420 }
419 421
420 PageSerializer::Delegate* PageSerializer::delegate() 422 PageSerializer::Delegate* PageSerializer::delegate()
421 { 423 {
422 return m_delegate.get(); 424 return m_delegate.get();
423 } 425 }
424 426
425 } // namespace blink 427 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | Source/web/tests/PageSerializerTest.cpp » ('j') | Source/web/tests/data/pageserializer/elements/elements.html » ('J')

Powered by Google App Engine
This is Rietveld 408576698