Changeset 148410 in webkit
- Timestamp:
- Apr 14, 2013 1:32:47 PM (11 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r148408 r148410 1 2013-04-14 Andreas Kling <akling@apple.com> 2 3 Only MutableStylePropertySets should be able to have CSSOM wrappers. 4 <http://webkit.org/b/114595> 5 6 Reviewed by Antti Koivisto. 7 8 Tighten typing so that only MutableStylePropertySets can have CSSOM wrappers associated. 9 This allows us to get rid of the out-of-line base class destructor. 10 11 * WebCore.exp.in: 12 * css/StylePropertySet.cpp: 13 (WebCore::MutableStylePropertySet::~MutableStylePropertySet): 14 (WebCore::MutableStylePropertySet::cssStyleDeclaration): 15 (WebCore::MutableStylePropertySet::ensureInlineCSSStyleDeclaration): 16 * css/StylePropertySet.h: 17 (StylePropertySet): 18 (MutableStylePropertySet): 19 * dom/StyledElement.cpp: 20 (WebCore::StyledElement::inlineStyleCSSOMWrapper): 21 1 22 2013-04-14 Andreas Kling <akling@apple.com> 2 23 -
trunk/Source/WebCore/WebCore.exp.in
r148396 r148410 534 534 __ZN7WebCore16ScriptController21processingUserGestureEv 535 535 __ZN7WebCore16ScriptController24jsObjectForPluginElementEPNS_17HTMLPlugInElementE 536 __ZN7WebCore16StylePropertySetD1Ev537 536 __ZN7WebCore16ThreadGlobalData10staticDataE 538 537 __ZN7WebCore16ThreadGlobalDataC1Ev … … 1790 1789 __ZN7WebCore16FontPlatformDataC1EP6NSFontfbbbNS_15FontOrientationENS_16FontWidthVariantE 1791 1790 __ZN7WebCore16FontPlatformDataC2EP6NSFontfbbbNS_15FontOrientationENS_16FontWidthVariantE 1792 __ZN7WebCore16StylePropertySetD2Ev1793 1791 __ZN7WebCore16colorFromNSColorEP7NSColor 1794 1792 __ZN7WebCore16enclosingIntRectERK7_NSRect -
trunk/Source/WebCore/css/StylePropertySet.cpp
r148406 r148410 1 1 /* 2 2 * (C) 1999-2003 Lars Knoll (knoll@kde.org) 3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012 Apple Inc. All rights reserved.3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012, 2013 Apple Inc. All rights reserved. 4 4 * Copyright (C) 2011 Research In Motion Limited. All rights reserved. 5 5 * … … 50 50 namespace WebCore { 51 51 52 typedef HashMap< constStylePropertySet*, OwnPtr<PropertySetCSSStyleDeclaration> > PropertySetCSSOMWrapperMap;52 typedef HashMap<MutableStylePropertySet*, OwnPtr<PropertySetCSSStyleDeclaration> > PropertySetCSSOMWrapperMap; 53 53 static PropertySetCSSOMWrapperMap& propertySetCSSOMWrapperMap() 54 54 { … … 122 122 } 123 123 124 StylePropertySet::~StylePropertySet()124 MutableStylePropertySet::~MutableStylePropertySet() 125 125 { 126 126 ASSERT(!m_ownsCSSOMWrapper || propertySetCSSOMWrapperMap().contains(this)); … … 1210 1210 } 1211 1211 1212 PropertySetCSSStyleDeclaration* StylePropertySet::cssStyleDeclaration()1212 PropertySetCSSStyleDeclaration* MutableStylePropertySet::cssStyleDeclaration() 1213 1213 { 1214 1214 if (!m_ownsCSSOMWrapper) 1215 1215 return 0; 1216 ASSERT(isMutable());1217 1216 return propertySetCSSOMWrapperMap().get(this); 1218 1217 } … … 1231 1230 } 1232 1231 1233 CSSStyleDeclaration* MutableStylePropertySet::ensureInlineCSSStyleDeclaration( constStyledElement* parentElement)1232 CSSStyleDeclaration* MutableStylePropertySet::ensureInlineCSSStyleDeclaration(StyledElement* parentElement) 1234 1233 { 1235 1234 if (m_ownsCSSOMWrapper) { … … 1238 1237 } 1239 1238 m_ownsCSSOMWrapper = true; 1240 PropertySetCSSStyleDeclaration* cssomWrapper = new InlineCSSStyleDeclaration(this, const_cast<StyledElement*>(parentElement));1239 PropertySetCSSStyleDeclaration* cssomWrapper = new InlineCSSStyleDeclaration(this, parentElement); 1241 1240 propertySetCSSOMWrapperMap().add(this, adoptPtr(cssomWrapper)); 1242 1241 return cssomWrapper; -
trunk/Source/WebCore/css/StylePropertySet.h
r148408 r148410 45 45 friend class PropertyReference; 46 46 public: 47 ~StylePropertySet();48 49 47 // Override RefCounted's deref() to ensure operator delete is called on 50 48 // the appropriate subclass type. … … 106 104 107 105 String asText() const; 108 109 PropertySetCSSStyleDeclaration* cssStyleDeclaration();110 106 111 107 bool isMutable() const { return m_isMutable; } … … 187 183 class MutableStylePropertySet : public StylePropertySet { 188 184 public: 185 ~MutableStylePropertySet(); 186 189 187 static PassRefPtr<MutableStylePropertySet> create(CSSParserMode = CSSQuirksMode); 190 188 static PassRefPtr<MutableStylePropertySet> create(const CSSProperty* properties, unsigned count); … … 193 191 194 192 unsigned propertyCount() const { return m_propertyVector.size(); } 193 194 PropertySetCSSStyleDeclaration* cssStyleDeclaration(); 195 195 196 196 void addParsedProperties(const Vector<CSSProperty>&); … … 220 220 221 221 CSSStyleDeclaration* ensureCSSStyleDeclaration(); 222 CSSStyleDeclaration* ensureInlineCSSStyleDeclaration( constStyledElement* parentElement);222 CSSStyleDeclaration* ensureInlineCSSStyleDeclaration(StyledElement* parentElement); 223 223 224 224 Vector<CSSProperty, 4> m_propertyVector; -
trunk/Source/WebCore/dom/StyledElement.cpp
r148397 r148410 174 174 if (!inlineStyle() || !inlineStyle()->hasCSSOMWrapper()) 175 175 return 0; 176 PropertySetCSSStyleDeclaration* cssomWrapper = ensure UniqueElementData()->m_inlineStyle->cssStyleDeclaration();176 PropertySetCSSStyleDeclaration* cssomWrapper = ensureMutableInlineStyle()->cssStyleDeclaration(); 177 177 ASSERT(cssomWrapper && cssomWrapper->parentElement() == this); 178 178 return cssomWrapper;
Note: See TracChangeset
for help on using the changeset viewer.