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

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

Issue 19186002: Introduce toHTMLLinkElement (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 7 years, 5 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
« no previous file with comments | « Source/core/html/HTMLLinkElement.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 206 matching lines...) Expand 10 before | Expand all | Expand 10 after
217 // We have to process in-line style as it might contain some resources ( typically background images). 217 // We have to process in-line style as it might contain some resources ( typically background images).
218 if (element->isStyledElement()) 218 if (element->isStyledElement())
219 retrieveResourcesForProperties(element->inlineStyle(), document); 219 retrieveResourcesForProperties(element->inlineStyle(), document);
220 220
221 if (element->hasTagName(HTMLNames::imgTag)) { 221 if (element->hasTagName(HTMLNames::imgTag)) {
222 HTMLImageElement* imageElement = toHTMLImageElement(element); 222 HTMLImageElement* imageElement = toHTMLImageElement(element);
223 KURL url = document->completeURL(imageElement->getAttribute(HTMLName s::srcAttr)); 223 KURL url = document->completeURL(imageElement->getAttribute(HTMLName s::srcAttr));
224 CachedImage* cachedImage = imageElement->cachedImage(); 224 CachedImage* cachedImage = imageElement->cachedImage();
225 addImageToResources(cachedImage, imageElement->renderer(), url); 225 addImageToResources(cachedImage, imageElement->renderer(), url);
226 } else if (element->hasTagName(HTMLNames::linkTag)) { 226 } else if (element->hasTagName(HTMLNames::linkTag)) {
227 HTMLLinkElement* linkElement = static_cast<HTMLLinkElement*>(element ); 227 HTMLLinkElement* linkElement = toHTMLLinkElement(element);
228 if (CSSStyleSheet* sheet = linkElement->sheet()) { 228 if (CSSStyleSheet* sheet = linkElement->sheet()) {
229 KURL url = document->completeURL(linkElement->getAttribute(HTMLN ames::hrefAttr)); 229 KURL url = document->completeURL(linkElement->getAttribute(HTMLN ames::hrefAttr));
230 serializeCSSStyleSheet(sheet, url); 230 serializeCSSStyleSheet(sheet, url);
231 ASSERT(m_resourceURLs.contains(url)); 231 ASSERT(m_resourceURLs.contains(url));
232 } 232 }
233 } else if (element->hasTagName(HTMLNames::styleTag)) { 233 } else if (element->hasTagName(HTMLNames::styleTag)) {
234 HTMLStyleElement* styleElement = toHTMLStyleElement(element); 234 HTMLStyleElement* styleElement = toHTMLStyleElement(element);
235 if (CSSStyleSheet* sheet = styleElement->sheet()) 235 if (CSSStyleSheet* sheet = styleElement->sheet())
236 serializeCSSStyleSheet(sheet, KURL()); 236 serializeCSSStyleSheet(sheet, KURL());
237 } 237 }
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
336 if (iter != m_blankFrameURLs.end()) 336 if (iter != m_blankFrameURLs.end())
337 return iter->value; 337 return iter->value;
338 String url = "wyciwyg://frame/" + String::number(m_blankFrameCounter++); 338 String url = "wyciwyg://frame/" + String::number(m_blankFrameCounter++);
339 KURL fakeURL(ParsedURLString, url); 339 KURL fakeURL(ParsedURLString, url);
340 m_blankFrameURLs.add(frame, fakeURL); 340 m_blankFrameURLs.add(frame, fakeURL);
341 341
342 return fakeURL; 342 return fakeURL;
343 } 343 }
344 344
345 } 345 }
OLDNEW
« no previous file with comments | « Source/core/html/HTMLLinkElement.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698