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 512 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
523 for (unsigned i = 0; i < propertyCount; ++i) { | 523 for (unsigned i = 0; i < propertyCount; ++i) { |
524 RefPtrWillBeRawPtr<CSSValue> cssValue = styleDeclaration->propertyAt(i).
value(); | 524 RefPtrWillBeRawPtr<CSSValue> cssValue = styleDeclaration->propertyAt(i).
value(); |
525 retrieveResourcesForCSSValue(cssValue.get(), document); | 525 retrieveResourcesForCSSValue(cssValue.get(), document); |
526 } | 526 } |
527 } | 527 } |
528 | 528 |
529 void PageSerializer::retrieveResourcesForCSSValue(CSSValue* cssValue, Document&
document) | 529 void PageSerializer::retrieveResourcesForCSSValue(CSSValue* cssValue, Document&
document) |
530 { | 530 { |
531 if (cssValue->isImageValue()) { | 531 if (cssValue->isImageValue()) { |
532 CSSImageValue* imageValue = toCSSImageValue(cssValue); | 532 CSSImageValue* imageValue = toCSSImageValue(cssValue); |
533 if (imageValue->isCachePending()) | 533 StyleImage* styleImage = imageValue->cachedOrPendingImage(); |
534 return; | 534 // Non cached-images are just place-holders and do not contain data. |
535 StyleImage* styleImage = imageValue->cachedImage(); | |
536 if (!styleImage || !styleImage->isImageResource()) | 535 if (!styleImage || !styleImage->isImageResource()) |
537 return; | 536 return; |
538 | 537 |
539 addImageToResources(styleImage->cachedImage(), nullptr, styleImage->cach
edImage()->url()); | 538 addImageToResources(styleImage->cachedImage(), nullptr, styleImage->cach
edImage()->url()); |
540 } else if (cssValue->isFontFaceSrcValue()) { | 539 } else if (cssValue->isFontFaceSrcValue()) { |
541 CSSFontFaceSrcValue* fontFaceSrcValue = toCSSFontFaceSrcValue(cssValue); | 540 CSSFontFaceSrcValue* fontFaceSrcValue = toCSSFontFaceSrcValue(cssValue); |
542 if (fontFaceSrcValue->isLocal()) { | 541 if (fontFaceSrcValue->isLocal()) { |
543 return; | 542 return; |
544 } | 543 } |
545 | 544 |
(...skipping 26 matching lines...) Expand all Loading... |
572 | 571 |
573 return fakeURL; | 572 return fakeURL; |
574 } | 573 } |
575 | 574 |
576 PageSerializer::Delegate* PageSerializer::delegate() | 575 PageSerializer::Delegate* PageSerializer::delegate() |
577 { | 576 { |
578 return m_delegate.get(); | 577 return m_delegate.get(); |
579 } | 578 } |
580 | 579 |
581 } // namespace blink | 580 } // namespace blink |
OLD | NEW |