Changeset 142827 in webkit
- Timestamp:
- Feb 13, 2013 5:11:12 PM (11 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r142826 r142827 1 2013-02-13 Andreas Kling <akling@apple.com> 2 3 Remove Element::getAttributeItem() overload that returned a mutable Attribute*. 4 <http://webkit.org/b/109756> 5 6 Reviewed by Antti Koivisto. 7 8 Remove this to prevent callers from accidentally causing elements to convert to UniqueElementData. 9 There are two call sites (Attr and HTMLSelectElement) that legitimately need to mutate Attribute 10 objects in-place, they now use Element::ensureUniqueElementData()->getAttributeItem() directly instead. 11 12 Small progression on Membuster3, mostly for peace of mind. 13 14 * dom/Attr.cpp: 15 (WebCore::Attr::elementAttribute): 16 * dom/Element.h: 17 (Element): 18 * html/HTMLInputElement.cpp: 19 (WebCore::HTMLInputElement::updateType): 20 * html/HTMLSelectElement.cpp: 21 (WebCore::HTMLSelectElement::parseAttribute): 22 * svg/SVGStyledElement.cpp: 23 (WebCore::SVGStyledElement::getPresentationAttribute): 24 1 25 2013-02-13 Andreas Kling <akling@apple.com> 2 26 -
trunk/Source/WebCore/dom/Attr.cpp
r142791 r142827 212 212 ASSERT(m_element); 213 213 ASSERT(m_element->elementData()); 214 return *m_element-> getAttributeItem(qualifiedName());214 return *m_element->ensureUniqueElementData()->getAttributeItem(qualifiedName()); 215 215 } 216 216 -
trunk/Source/WebCore/dom/Element.h
r142826 r142827 286 286 const Attribute* attributeItem(unsigned index) const; 287 287 const Attribute* getAttributeItem(const QualifiedName&) const; 288 Attribute* getAttributeItem(const QualifiedName&);289 288 size_t getAttributeItemIndex(const QualifiedName& name) const { return elementData()->getAttributeItemIndex(name); } 290 289 size_t getAttributeItemIndex(const AtomicString& name, bool shouldIgnoreAttributeCase) const { return elementData()->getAttributeItemIndex(name, shouldIgnoreAttributeCase); } … … 905 904 } 906 905 907 inline Attribute* Element::getAttributeItem(const QualifiedName& name)908 {909 ASSERT(elementData());910 return ensureUniqueElementData()->getAttributeItem(name);911 }912 913 906 inline void Element::updateInvalidAttributes() const 914 907 { -
trunk/Source/WebCore/html/HTMLInputElement.cpp
r142791 r142827 517 517 if (didRespectHeightAndWidth != m_inputType->shouldRespectHeightAndWidthAttributes()) { 518 518 ASSERT(elementData()); 519 if ( Attribute* height = getAttributeItem(heightAttr))519 if (const Attribute* height = getAttributeItem(heightAttr)) 520 520 attributeChanged(heightAttr, height->value()); 521 if ( Attribute* width = getAttributeItem(widthAttr))521 if (const Attribute* width = getAttributeItem(widthAttr)) 522 522 attributeChanged(widthAttr, width->value()); 523 if ( Attribute* align = getAttributeItem(alignAttr))523 if (const Attribute* align = getAttributeItem(alignAttr)) 524 524 attributeChanged(alignAttr, align->value()); 525 525 } -
trunk/Source/WebCore/html/HTMLSelectElement.cpp
r142631 r142827 292 292 if (attrSize != value) { 293 293 // FIXME: This is horribly factored. 294 if (Attribute* sizeAttribute = getAttributeItem(sizeAttr))294 if (Attribute* sizeAttribute = ensureUniqueElementData()->getAttributeItem(sizeAttr)) 295 295 sizeAttribute->setValue(attrSize); 296 296 } -
trunk/Source/WebCore/svg/SVGStyledElement.cpp
r141524 r142827 401 401 402 402 QualifiedName attributeName(nullAtom, name, nullAtom); 403 Attribute* attr = getAttributeItem(attributeName);403 const Attribute* attr = getAttributeItem(attributeName); 404 404 if (!attr) 405 405 return 0;
Note: See TracChangeset
for help on using the changeset viewer.