Changeset 142714 in webkit
- Timestamp:
- Feb 12, 2013 8:27:41 PM (11 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r142713 r142714 1 2013-02-12 Andreas Kling <akling@apple.com> 2 3 Remove Element::ensureAttributeData(). 4 <http://webkit.org/b/109643> 5 6 Reviewed by Anders Carlsson. 7 8 * dom/Element.h: 9 * dom/Element.cpp: 10 (WebCore::Element::classAttributeChanged): 11 (WebCore::Element::shouldInvalidateDistributionWhenAttributeChanged): 12 13 Use attributeData() instead of ensureAttributeData(), it's already guaranteed to exist in 14 both these functions as they are called in response to attribute changes. 15 16 * svg/SVGElement.h: 17 (WebCore::SVGElement::invalidateSVGAttributes): 18 19 Use mutableAttributeData() instead of ensureAttributeData() when invalidating animated 20 SVG attributes. While I can't find any bugs caused by this, an element with property animations 21 shouldn't share attribute data with other elements. 22 1 23 2013-02-12 Hayato Ito <hayato@chromium.org> 2 24 -
trunk/Source/WebCore/dom/Element.cpp
r142698 r142714 922 922 923 923 if (classStringHasClassName(newClassString)) { 924 const ElementAttributeData* attributeData = ensureAttributeData();925 924 const bool shouldFoldCase = document()->inQuirksMode(); 926 const SpaceSplitString oldClasses = attributeData->classNames(); 927 928 attributeData->setClass(newClassString, shouldFoldCase); 929 930 const SpaceSplitString& newClasses = attributeData->classNames(); 925 const SpaceSplitString oldClasses = attributeData()->classNames(); 926 attributeData()->setClass(newClassString, shouldFoldCase); 927 const SpaceSplitString& newClasses = attributeData()->classNames(); 931 928 shouldInvalidateStyle = testShouldInvalidateStyle && checkSelectorForClassChange(oldClasses, newClasses, *styleResolver); 932 } else if (const ElementAttributeData* attributeData = this->attributeData()){933 const SpaceSplitString& oldClasses = attributeData ->classNames();929 } else { 930 const SpaceSplitString& oldClasses = attributeData()->classNames(); 934 931 shouldInvalidateStyle = testShouldInvalidateStyle && checkSelectorForClassChange(oldClasses, *styleResolver); 935 936 attributeData->clearClass(); 932 attributeData()->clearClass(); 937 933 } 938 934 … … 963 959 const AtomicString& newClassString = newValue; 964 960 if (classStringHasClassName(newClassString)) { 965 const ElementAttributeData* attributeData = ensureAttributeData();966 961 const bool shouldFoldCase = document()->inQuirksMode(); 967 const SpaceSplitString& oldClasses = attributeData ->classNames();962 const SpaceSplitString& oldClasses = attributeData()->classNames(); 968 963 const SpaceSplitString newClasses(newClassString, shouldFoldCase); 969 964 if (checkSelectorForClassChange(oldClasses, newClasses, featureSet)) 970 965 return true; 971 } else if (const ElementAttributeData* attributeData = this->attributeData()){972 const SpaceSplitString& oldClasses = attributeData ->classNames();966 } else { 967 const SpaceSplitString& oldClasses = attributeData()->classNames(); 973 968 if (checkSelectorForClassChange(oldClasses, featureSet)) 974 969 return true; -
trunk/Source/WebCore/dom/Element.h
r142698 r142714 374 374 const ElementAttributeData* attributeData() const { return m_attributeData.get(); } 375 375 ElementAttributeData* mutableAttributeData(); 376 const ElementAttributeData* ensureAttributeData();377 376 const ElementAttributeData* updatedAttributeData() const; 378 377 const ElementAttributeData* ensureUpdatedAttributeData() const; … … 785 784 } 786 785 787 inline const ElementAttributeData* Element::ensureAttributeData()788 {789 if (attributeData())790 return attributeData();791 return mutableAttributeData();792 }793 794 786 inline const ElementAttributeData* Element::ensureUpdatedAttributeData() const 795 787 { -
trunk/Source/WebCore/svg/SVGElement.h
r141516 r142714 80 80 virtual AffineTransform* supplementalTransform() { return 0; } 81 81 82 void invalidateSVGAttributes() { ensureAttributeData()->m_animatedSVGAttributesAreDirty = true; }82 void invalidateSVGAttributes() { mutableAttributeData()->m_animatedSVGAttributesAreDirty = true; } 83 83 84 84 const HashSet<SVGElementInstance*>& instancesForElement() const;
Note: See TracChangeset
for help on using the changeset viewer.