OLD | NEW |
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 209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
220 | 220 |
221 Element& element = toElement(*node); | 221 Element& element = toElement(*node); |
222 // We have to process in-line style as it might contain some resources (
typically background images). | 222 // We have to process in-line style as it might contain some resources (
typically background images). |
223 if (element.isStyledElement()) | 223 if (element.isStyledElement()) |
224 retrieveResourcesForProperties(element.inlineStyle(), document); | 224 retrieveResourcesForProperties(element.inlineStyle(), document); |
225 | 225 |
226 if (isHTMLImageElement(element)) { | 226 if (isHTMLImageElement(element)) { |
227 HTMLImageElement& imageElement = toHTMLImageElement(element); | 227 HTMLImageElement& imageElement = toHTMLImageElement(element); |
228 KURL url = document.completeURL(imageElement.getAttribute(HTMLNames:
:srcAttr)); | 228 KURL url = document.completeURL(imageElement.getAttribute(HTMLNames:
:srcAttr)); |
229 ImageResource* cachedImage = imageElement.cachedImage(); | 229 ImageResource* cachedImage = imageElement.cachedImage(); |
230 addImageToResources(cachedImage, imageElement.renderer(), url); | 230 addImageToResources(cachedImage, imageElement.layoutObject(), url); |
231 } else if (isHTMLInputElement(element)) { | 231 } else if (isHTMLInputElement(element)) { |
232 HTMLInputElement& inputElement = toHTMLInputElement(element); | 232 HTMLInputElement& inputElement = toHTMLInputElement(element); |
233 if (inputElement.type() == InputTypeNames::image && inputElement.ima
geLoader()) { | 233 if (inputElement.type() == InputTypeNames::image && inputElement.ima
geLoader()) { |
234 KURL url = inputElement.src(); | 234 KURL url = inputElement.src(); |
235 ImageResource* cachedImage = inputElement.imageLoader()->image()
; | 235 ImageResource* cachedImage = inputElement.imageLoader()->image()
; |
236 addImageToResources(cachedImage, inputElement.renderer(), url); | 236 addImageToResources(cachedImage, inputElement.layoutObject(), ur
l); |
237 } | 237 } |
238 } else if (isHTMLLinkElement(element)) { | 238 } else if (isHTMLLinkElement(element)) { |
239 HTMLLinkElement& linkElement = toHTMLLinkElement(element); | 239 HTMLLinkElement& linkElement = toHTMLLinkElement(element); |
240 if (CSSStyleSheet* sheet = linkElement.sheet()) { | 240 if (CSSStyleSheet* sheet = linkElement.sheet()) { |
241 KURL url = document.completeURL(linkElement.getAttribute(HTMLNam
es::hrefAttr)); | 241 KURL url = document.completeURL(linkElement.getAttribute(HTMLNam
es::hrefAttr)); |
242 serializeCSSStyleSheet(*sheet, url); | 242 serializeCSSStyleSheet(*sheet, url); |
243 ASSERT(m_resourceURLs.contains(url)); | 243 ASSERT(m_resourceURLs.contains(url)); |
244 } | 244 } |
245 } else if (isHTMLStyleElement(element)) { | 245 } else if (isHTMLStyleElement(element)) { |
246 HTMLStyleElement& styleElement = toHTMLStyleElement(element); | 246 HTMLStyleElement& styleElement = toHTMLStyleElement(element); |
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
381 if (iter != m_blankFrameURLs.end()) | 381 if (iter != m_blankFrameURLs.end()) |
382 return iter->value; | 382 return iter->value; |
383 String url = "wyciwyg://frame/" + String::number(m_blankFrameCounter++); | 383 String url = "wyciwyg://frame/" + String::number(m_blankFrameCounter++); |
384 KURL fakeURL(ParsedURLString, url); | 384 KURL fakeURL(ParsedURLString, url); |
385 m_blankFrameURLs.add(frame, fakeURL); | 385 m_blankFrameURLs.add(frame, fakeURL); |
386 | 386 |
387 return fakeURL; | 387 return fakeURL; |
388 } | 388 } |
389 | 389 |
390 } // namespace blink | 390 } // namespace blink |
OLD | NEW |