Changeset 106746 in webkit
- Timestamp:
- Feb 4, 2012 2:56:28 PM (12 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 19 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r106744 r106746 1 2012-02-04 Andreas Kling <awesomekling@apple.com> 2 3 Element: Remove unnecessary attributeChanged() argument. 4 <http://webkit.org/b/77814> 5 6 Reviewed by Ryosuke Niwa. 7 8 Remove the 'preserveDecls' argument to Element::attributeChanged() as that is no 9 longer needed after the removal of per-attribute style declarations. 10 Decorated subclass overrides with OVERRIDE since we're touching the lines. 11 12 Also removed an old inaccurate comment in NamedNodeMap::setAttributes() - calling 13 attributeChanged() is absolutely necessary to initialize element-specific state. 14 15 * dom/Element.cpp: 16 (WebCore::Element::attributeChanged): 17 * dom/Element.h: 18 (Element): 19 * dom/NamedNodeMap.cpp: 20 (WebCore::NamedNodeMap::setAttributes): 21 * dom/StyledElement.cpp: 22 (WebCore::StyledElement::attributeChanged): 23 * dom/StyledElement.h: 24 (StyledElement): 25 * html/HTMLInputElement.cpp: 26 (WebCore::HTMLInputElement::updateType): 27 * html/HTMLMediaElement.cpp: 28 (WebCore::HTMLMediaElement::attributeChanged): 29 * html/HTMLMediaElement.h: 30 (HTMLMediaElement): 31 * html/HTMLScriptElement.cpp: 32 (WebCore::HTMLScriptElement::attributeChanged): 33 * html/HTMLScriptElement.h: 34 (HTMLScriptElement): 35 * html/HTMLTrackElement.cpp: 36 (WebCore::HTMLTrackElement::attributeChanged): 37 * html/HTMLTrackElement.h: 38 (HTMLTrackElement): 39 * svg/SVGAnimationElement.cpp: 40 (WebCore::SVGAnimationElement::attributeChanged): 41 * svg/SVGAnimationElement.h: 42 * svg/SVGElement.cpp: 43 (WebCore::SVGElement::attributeChanged): 44 * svg/SVGElement.h: 45 (SVGElement): 46 * svg/animation/SVGSMILElement.cpp: 47 (WebCore::SVGSMILElement::attributeChanged): 48 * svg/animation/SVGSMILElement.h: 49 (SVGSMILElement): 50 1 51 2012-02-04 Ken Buchanan <kenrb@chromium.org> 2 52 -
trunk/Source/WebCore/dom/Element.cpp
r106626 r106746 656 656 } 657 657 658 void Element::attributeChanged(Attribute* attr , bool)658 void Element::attributeChanged(Attribute* attr) 659 659 { 660 660 if (isIdAttributeName(attr->name())) -
trunk/Source/WebCore/dom/Element.h
r106740 r106746 222 222 223 223 // This method is called whenever an attribute is added, changed or removed. 224 // FIXME: Remove the preserveDecls argument. 225 virtual void attributeChanged(Attribute*, bool preserveDecls = false); 224 virtual void attributeChanged(Attribute*); 226 225 227 226 // Only called by the parser immediately after element construction. -
trunk/Source/WebCore/dom/NamedNodeMap.cpp
r106740 r106746 240 240 unsigned newLength = other.length(); 241 241 m_attributes.resize(newLength); 242 243 // FIXME: These loops can probably be combined. 242 244 for (unsigned i = 0; i < newLength; i++) 243 245 m_attributes[i] = other.m_attributes[i]->clone(); 244 245 // FIXME: This is wasteful. The class list could be preserved on a copy, and we246 // wouldn't have to waste time reparsing the attribute.247 // The derived class, HTMLNamedNodeMap, which manages a parsed class list for the CLASS attribute,248 // will update its member variable when parse attribute is called.249 246 for (unsigned i = 0; i < newLength; i++) 250 m_element->attributeChanged(m_attributes[i].get() , true);247 m_element->attributeChanged(m_attributes[i].get()); 251 248 } 252 249 -
trunk/Source/WebCore/dom/StyledElement.cpp
r106740 r106746 65 65 } 66 66 67 void StyledElement::attributeChanged(Attribute* attr , bool preserveDecls)67 void StyledElement::attributeChanged(Attribute* attr) 68 68 { 69 69 if (attr->name() == HTMLNames::nameAttr) … … 71 71 72 72 if (!attr->isMappedAttribute()) { 73 Element::attributeChanged(attr , preserveDecls);73 Element::attributeChanged(attr); 74 74 return; 75 75 } -
trunk/Source/WebCore/dom/StyledElement.h
r106740 r106746 69 69 } 70 70 71 virtual void attributeChanged(Attribute* , bool preserveDecls = false);71 virtual void attributeChanged(Attribute*) OVERRIDE; 72 72 virtual void parseMappedAttribute(Attribute*); 73 73 virtual void copyNonAttributeProperties(const Element*); -
trunk/Source/WebCore/html/HTMLInputElement.cpp
r106740 r106746 549 549 ASSERT(map); 550 550 if (Attribute* height = map->getAttributeItem(heightAttr)) 551 attributeChanged(height , false);551 attributeChanged(height); 552 552 if (Attribute* width = map->getAttributeItem(widthAttr)) 553 attributeChanged(width , false);553 attributeChanged(width); 554 554 if (Attribute* align = map->getAttributeItem(alignAttr)) 555 attributeChanged(align , false);555 attributeChanged(align); 556 556 } 557 557 -
trunk/Source/WebCore/html/HTMLMediaElement.cpp
r106531 r106746 316 316 } 317 317 318 void HTMLMediaElement::attributeChanged(Attribute* attr , bool preserveDecls)319 { 320 HTMLElement::attributeChanged(attr , preserveDecls);318 void HTMLMediaElement::attributeChanged(Attribute* attr) 319 { 320 HTMLElement::attributeChanged(attr); 321 321 322 322 const QualifiedName& attrName = attr->name(); -
trunk/Source/WebCore/html/HTMLMediaElement.h
r106531 r106746 337 337 338 338 virtual bool supportsFocus() const; 339 virtual void attributeChanged(Attribute* , bool preserveDecls);339 virtual void attributeChanged(Attribute*) OVERRIDE; 340 340 virtual bool rendererIsNeeded(const NodeRenderingContext&); 341 341 virtual RenderObject* createRenderer(RenderArena*, RenderStyle*); -
trunk/Source/WebCore/html/HTMLScriptElement.cpp
r104927 r106746 59 59 } 60 60 61 void HTMLScriptElement::attributeChanged(Attribute* attr , bool preserveDecls)61 void HTMLScriptElement::attributeChanged(Attribute* attr) 62 62 { 63 63 if (attr->name() == asyncAttr) 64 64 handleAsyncAttribute(); 65 HTMLElement::attributeChanged(attr , preserveDecls);65 HTMLElement::attributeChanged(attr); 66 66 } 67 67 -
trunk/Source/WebCore/html/HTMLScriptElement.h
r104927 r106746 48 48 virtual void insertedIntoDocument(); 49 49 virtual void childrenChanged(bool changedByParser = false, Node* beforeChange = 0, Node* afterChange = 0, int childCountDelta = 0); 50 virtual void attributeChanged(Attribute* , bool preserveDecls = false);50 virtual void attributeChanged(Attribute*) OVERRIDE; 51 51 52 52 virtual bool isURLAttribute(Attribute*) const; -
trunk/Source/WebCore/html/HTMLTrackElement.cpp
r105668 r106746 101 101 } 102 102 103 void HTMLTrackElement::attributeChanged(Attribute* attr , bool preserveDecls)104 { 105 HTMLElement::attributeChanged(attr , preserveDecls);103 void HTMLTrackElement::attributeChanged(Attribute* attr) 104 { 105 HTMLElement::attributeChanged(attr); 106 106 107 107 if (!RuntimeEnabledFeatures::webkitVideoTrackEnabled()) -
trunk/Source/WebCore/html/HTMLTrackElement.h
r105434 r106746 77 77 78 78 virtual void parseMappedAttribute(Attribute*); 79 virtual void attributeChanged(Attribute* , bool preserveDecls);79 virtual void attributeChanged(Attribute*) OVERRIDE; 80 80 81 81 virtual void insertedIntoDocument() OVERRIDE; -
trunk/Source/WebCore/svg/SVGAnimationElement.cpp
r103296 r106746 202 202 } 203 203 204 void SVGAnimationElement::attributeChanged(Attribute* attr , bool preserveDecls)204 void SVGAnimationElement::attributeChanged(Attribute* attr) 205 205 { 206 206 // Assumptions may not hold after an attribute change. 207 207 m_animationValid = false; 208 208 setInactive(); 209 SVGSMILElement::attributeChanged(attr , preserveDecls);209 SVGSMILElement::attributeChanged(attr); 210 210 } 211 211 -
trunk/Source/WebCore/svg/SVGAnimationElement.h
r95907 r106746 108 108 109 109 private: 110 virtual void attributeChanged(Attribute* , bool preserveDecls);110 virtual void attributeChanged(Attribute*) OVERRIDE; 111 111 112 112 virtual bool calculateFromAndToValues(const String& fromString, const String& toString) = 0; -
trunk/Source/WebCore/svg/SVGElement.cpp
r97670 r106746 360 360 } 361 361 362 void SVGElement::attributeChanged(Attribute* attr , bool preserveDecls)362 void SVGElement::attributeChanged(Attribute* attr) 363 363 { 364 364 ASSERT(attr); … … 366 366 return; 367 367 368 StyledElement::attributeChanged(attr , preserveDecls);368 StyledElement::attributeChanged(attr); 369 369 370 370 // When an animated SVG property changes through SVG DOM, svgAttributeChanged() is called, not attributeChanged(). -
trunk/Source/WebCore/svg/SVGElement.h
r100075 r106746 112 112 113 113 virtual void finishParsingChildren(); 114 virtual void attributeChanged(Attribute* , bool preserveDecls = false);114 virtual void attributeChanged(Attribute*) OVERRIDE; 115 115 virtual bool childShouldCreateRenderer(Node*) const; 116 116 -
trunk/Source/WebCore/svg/animation/SVGSMILElement.cpp
r105572 r106746 407 407 } 408 408 409 void SVGSMILElement::attributeChanged(Attribute* attr , bool preserveDecls)410 { 411 SVGElement::attributeChanged(attr , preserveDecls);412 409 void SVGSMILElement::attributeChanged(Attribute* attr) 410 { 411 SVGElement::attributeChanged(attr); 412 413 413 const QualifiedName& attrName = attr->name(); 414 414 if (attrName == SVGNames::durAttr) -
trunk/Source/WebCore/svg/animation/SVGSMILElement.h
r104719 r106746 46 46 47 47 virtual void parseMappedAttribute(Attribute*); 48 virtual void attributeChanged(Attribute* , bool preserveDecls);48 virtual void attributeChanged(Attribute*) OVERRIDE; 49 49 virtual void insertedIntoDocument(); 50 50 virtual void removedFromDocument();
Note: See TracChangeset
for help on using the changeset viewer.