diff options
author | Allan Sandfeld Jensen <allan.jensen@digia.com> | 2013-09-13 12:51:20 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-09-19 20:50:05 +0200 |
commit | d441d6f39bb846989d95bcf5caf387b42414718d (patch) | |
tree | e367e64a75991c554930278175d403c072de6bb8 /Source/WebCore/css/CSSImageSetValue.cpp | |
parent | 0060b2994c07842f4c59de64b5e3e430525c4b90 (diff) | |
download | qtwebkit-d441d6f39bb846989d95bcf5caf387b42414718d.tar.gz |
Import Qt5x2 branch of QtWebkit for Qt 5.2
Importing a new snapshot of webkit.
Change-Id: I2d01ad12cdc8af8cb015387641120a9d7ea5f10c
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@digia.com>
Diffstat (limited to 'Source/WebCore/css/CSSImageSetValue.cpp')
-rw-r--r-- | Source/WebCore/css/CSSImageSetValue.cpp | 34 |
1 files changed, 11 insertions, 23 deletions
diff --git a/Source/WebCore/css/CSSImageSetValue.cpp b/Source/WebCore/css/CSSImageSetValue.cpp index 050f201c3..cbd8a4333 100644 --- a/Source/WebCore/css/CSSImageSetValue.cpp +++ b/Source/WebCore/css/CSSImageSetValue.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2012 Apple Inc. All rights reserved. + * Copyright (C) 2012, 2013 Apple Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -38,8 +38,7 @@ #include "Page.h" #include "StyleCachedImageSet.h" #include "StylePendingImage.h" -#include "WebCoreMemoryInstrumentation.h" -#include <wtf/MemoryInstrumentationVector.h> +#include <wtf/text/StringBuilder.h> namespace WebCore { @@ -52,6 +51,8 @@ CSSImageSetValue::CSSImageSetValue() CSSImageSetValue::~CSSImageSetValue() { + if (m_imageSet && m_imageSet->isCachedImageSet()) + static_cast<StyleCachedImageSet*>(m_imageSet.get())->clearImageSetValue(); } void CSSImageSetValue::fillImageSet() @@ -60,13 +61,13 @@ void CSSImageSetValue::fillImageSet() size_t i = 0; while (i < length) { CSSValue* imageValue = item(i); - ASSERT(imageValue->isImageValue()); + ASSERT_WITH_SECURITY_IMPLICATION(imageValue->isImageValue()); String imageURL = static_cast<CSSImageValue*>(imageValue)->url(); ++i; - ASSERT(i < length); + ASSERT_WITH_SECURITY_IMPLICATION(i < length); CSSValue* scaleFactorValue = item(i); - ASSERT(scaleFactorValue->isPrimitiveValue()); + ASSERT_WITH_SECURITY_IMPLICATION(scaleFactorValue->isPrimitiveValue()); float scaleFactor = static_cast<CSSPrimitiveValue*>(scaleFactorValue)->getFloatValue(); ImageWithScale image; @@ -143,20 +144,20 @@ StyleImage* CSSImageSetValue::cachedOrPendingImageSet(Document* document) String CSSImageSetValue::customCssText() const { StringBuilder result; - result.append("-webkit-image-set("); + result.appendLiteral("-webkit-image-set("); size_t length = this->length(); size_t i = 0; while (i < length) { if (i > 0) - result.append(", "); + result.appendLiteral(", "); const CSSValue* imageValue = item(i); result.append(imageValue->cssText()); result.append(' '); ++i; - ASSERT(i < length); + ASSERT_WITH_SECURITY_IMPLICATION(i < length); const CSSValue* scaleFactorValue = item(i); result.append(scaleFactorValue->cssText()); // FIXME: Eventually the scale factor should contain it's own unit http://wkb.ug/100120. @@ -166,7 +167,7 @@ String CSSImageSetValue::customCssText() const ++i; } - result.append(")"); + result.append(')'); return result.toString(); } @@ -193,19 +194,6 @@ PassRefPtr<CSSImageSetValue> CSSImageSetValue::cloneForCSSOM() const return adoptRef(new CSSImageSetValue(*this)); } -void CSSImageSetValue::reportDescendantMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const -{ - MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::CSS); - CSSValueList::reportDescendantMemoryUsage(memoryObjectInfo); - info.addMember(m_imagesInSet); -} - -void CSSImageSetValue::ImageWithScale::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const -{ - MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::CSS); - info.addMember(imageURL); -} - } // namespace WebCore #endif // ENABLE(CSS_IMAGE_SET) |