| 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 311 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 322 | 322 |
| 323 // The background-image and list-style-image (for ul or ol) are the CSS prop
erties | 323 // The background-image and list-style-image (for ul or ol) are the CSS prop
erties |
| 324 // that make use of images. We iterate to make sure we include any other | 324 // that make use of images. We iterate to make sure we include any other |
| 325 // image properties there might be. | 325 // image properties there might be. |
| 326 unsigned propertyCount = styleDeclaration->propertyCount(); | 326 unsigned propertyCount = styleDeclaration->propertyCount(); |
| 327 for (unsigned i = 0; i < propertyCount; ++i) { | 327 for (unsigned i = 0; i < propertyCount; ++i) { |
| 328 RefPtr<CSSValue> cssValue = styleDeclaration->propertyAt(i).value(); | 328 RefPtr<CSSValue> cssValue = styleDeclaration->propertyAt(i).value(); |
| 329 if (!cssValue->isImageValue()) | 329 if (!cssValue->isImageValue()) |
| 330 continue; | 330 continue; |
| 331 | 331 |
| 332 CSSImageValue* imageValue = static_cast<CSSImageValue*>(cssValue.get()); | 332 CSSImageValue* imageValue = toCSSImageValue(cssValue.get()); |
| 333 StyleImage* styleImage = imageValue->cachedOrPendingImage(); | 333 StyleImage* styleImage = imageValue->cachedOrPendingImage(); |
| 334 // Non cached-images are just place-holders and do not contain data. | 334 // Non cached-images are just place-holders and do not contain data. |
| 335 if (!styleImage || !styleImage->isCachedImage()) | 335 if (!styleImage || !styleImage->isCachedImage()) |
| 336 continue; | 336 continue; |
| 337 | 337 |
| 338 CachedImage* image = static_cast<StyleCachedImage*>(styleImage)->cachedI
mage(); | 338 CachedImage* image = static_cast<StyleCachedImage*>(styleImage)->cachedI
mage(); |
| 339 addImageToResources(image, 0, image->url()); | 339 addImageToResources(image, 0, image->url()); |
| 340 } | 340 } |
| 341 } | 341 } |
| 342 | 342 |
| 343 KURL PageSerializer::urlForBlankFrame(Frame* frame) | 343 KURL PageSerializer::urlForBlankFrame(Frame* frame) |
| 344 { | 344 { |
| 345 HashMap<Frame*, KURL>::iterator iter = m_blankFrameURLs.find(frame); | 345 HashMap<Frame*, KURL>::iterator iter = m_blankFrameURLs.find(frame); |
| 346 if (iter != m_blankFrameURLs.end()) | 346 if (iter != m_blankFrameURLs.end()) |
| 347 return iter->value; | 347 return iter->value; |
| 348 String url = "wyciwyg://frame/" + String::number(m_blankFrameCounter++); | 348 String url = "wyciwyg://frame/" + String::number(m_blankFrameCounter++); |
| 349 KURL fakeURL(ParsedURLString, url); | 349 KURL fakeURL(ParsedURLString, url); |
| 350 m_blankFrameURLs.add(frame, fakeURL); | 350 m_blankFrameURLs.add(frame, fakeURL); |
| 351 | 351 |
| 352 return fakeURL; | 352 return fakeURL; |
| 353 } | 353 } |
| 354 | 354 |
| 355 } | 355 } |
| OLD | NEW |