| 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 206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 Loading... |
| 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 } |
| OLD | NEW |