diff options
| author | Simon Hausmann <simon.hausmann@nokia.com> | 2012-08-12 09:27:39 +0200 |
|---|---|---|
| committer | Simon Hausmann <simon.hausmann@nokia.com> | 2012-08-12 09:27:39 +0200 |
| commit | 3749d61e1f7a59f5ec5067e560af1eb610c82015 (patch) | |
| tree | 73dc228333948738bbe02976cacca8cd382bc978 /Source/WebCore/css/StylePropertySet.cpp | |
| parent | b32b4dcd9a51ab8de6afc53d9e17f8707e1f7a5e (diff) | |
| download | qtwebkit-3749d61e1f7a59f5ec5067e560af1eb610c82015.tar.gz | |
Imported WebKit commit a77350243e054f3460d1137301d8b3faee3d2052 (http://svn.webkit.org/repository/webkit/trunk@125365)
New snapshot with build fixes for latest API changes in Qt and all WK1 Win MSVC fixes upstream
Diffstat (limited to 'Source/WebCore/css/StylePropertySet.cpp')
| -rw-r--r-- | Source/WebCore/css/StylePropertySet.cpp | 30 |
1 files changed, 28 insertions, 2 deletions
diff --git a/Source/WebCore/css/StylePropertySet.cpp b/Source/WebCore/css/StylePropertySet.cpp index 0c25a5a9c..a48728ae6 100644 --- a/Source/WebCore/css/StylePropertySet.cpp +++ b/Source/WebCore/css/StylePropertySet.cpp @@ -894,6 +894,16 @@ void StylePropertySet::addSubresourceStyleURLs(ListHashSet<KURL>& urls, StyleShe propertyAt(i).value()->addSubresourceStyleURLs(urls, contextStyleSheet); } +bool StylePropertySet::hasFailedOrCanceledSubresources() const +{ + unsigned size = propertyCount(); + for (unsigned i = 0; i < size; ++i) { + if (propertyAt(i).value()->hasFailedOrCanceledSubresources()) + return true; + } + return false; +} + // This is the list of properties we want to copy in the copyBlockProperties() function. // It is the list of CSS properties that apply specially to block-level elements. static const CSSPropertyID blockProperties[] = { @@ -1036,8 +1046,10 @@ PassRefPtr<StylePropertySet> StylePropertySet::copyPropertiesInSet(const CSSProp return StylePropertySet::create(list.data(), list.size()); } -CSSStyleDeclaration* StylePropertySet::ensureCSSStyleDeclaration() const +CSSStyleDeclaration* StylePropertySet::ensureCSSStyleDeclaration() { + ASSERT(isMutable()); + if (m_ownsCSSOMWrapper) { ASSERT(!static_cast<CSSStyleDeclaration*>(propertySetCSSOMWrapperMap().get(this))->parentRule()); ASSERT(!propertySetCSSOMWrapperMap().get(this)->parentElement()); @@ -1049,8 +1061,10 @@ CSSStyleDeclaration* StylePropertySet::ensureCSSStyleDeclaration() const return cssomWrapper; } -CSSStyleDeclaration* StylePropertySet::ensureInlineCSSStyleDeclaration(const StyledElement* parentElement) const +CSSStyleDeclaration* StylePropertySet::ensureInlineCSSStyleDeclaration(const StyledElement* parentElement) { + ASSERT(isMutable()); + if (m_ownsCSSOMWrapper) { ASSERT(propertySetCSSOMWrapperMap().get(this)->parentElement() == parentElement); return propertySetCSSOMWrapperMap().get(this); @@ -1075,6 +1089,18 @@ unsigned StylePropertySet::averageSizeInBytes() return sizeof(StylePropertySet) + sizeof(CSSProperty) * 2; } +void StylePropertySet::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const +{ + MemoryClassInfo info(memoryObjectInfo, this, MemoryInstrumentation::CSS); + if (m_isMutable) + info.addVectorPtr(m_mutablePropertyVector); + else + info.addRawBuffer(m_properties, m_arraySize * sizeof(CSSProperty)); + unsigned count = propertyCount(); + for (unsigned i = 0; i < count; ++i) + info.addInstrumentedMember(propertyAt(i)); +} + // See the function above if you need to update this. struct SameSizeAsStylePropertySet : public RefCounted<SameSizeAsStylePropertySet> { unsigned bitfield; |
