Changeset 103116 in webkit
- Timestamp:
- Dec 16, 2011 3:15:10 PM (12 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 20 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r103115 r103116 1 2011-12-16 Ryosuke Niwa <rniwa@webkit.org> 2 3 invalidateNodeListsCacheAfterAttributeChanged has too many callers 4 https://bugs.webkit.org/show_bug.cgi?id=74692 5 6 Reviewed by Sam Weinig. 7 8 Add a regression test for setting Attr's value. WebKit should invalidate the cache as needed. 9 10 * fast/dom/Attr/invalidate-nodelist-after-attr-setvalue-expected.txt: Added. 11 * fast/dom/Attr/invalidate-nodelist-after-attr-setvalue.html: Added. 12 1 13 2011-12-16 Andreas Kling <kling@webkit.org> 2 14 -
trunk/Source/WebCore/ChangeLog
r103115 r103116 1 2011-12-16 Ryosuke Niwa <rniwa@webkit.org> 2 3 invalidateNodeListsCacheAfterAttributeChanged has too many callers 4 https://bugs.webkit.org/show_bug.cgi?id=74692 5 6 Reviewed by Sam Weinig. 7 8 Call invalidateNodeListsCacheAfterAttributeChanged in Element::updateAfterAttributeChanged instead of 9 parsedMappedAttribute of various elements. Also make invalidateNodeListsCacheAfterAttributeChanged take 10 the qualified name of the changed attribute so that we can exit early when the changed attribute isn't 11 one of attributes we care. 12 13 In addition, added a missing call to invalidateNodeListsCacheAfterAttributeChanged in Attr::setValue. 14 15 Test: fast/dom/Attr/invalidate-nodelist-after-attr-setvalue.html 16 17 * dom/Attr.cpp: 18 (WebCore::Attr::childrenChanged): 19 * dom/Element.cpp: 20 (WebCore::Element::updateAfterAttributeChanged): 21 * dom/NamedNodeMap.cpp: 22 (WebCore::NamedNodeMap::addAttribute): 23 (WebCore::NamedNodeMap::removeAttribute): 24 * dom/Node.cpp: 25 (WebCore::Node::invalidateNodeListsCacheAfterAttributeChanged): 26 * dom/Node.h: 27 * dom/StyledElement.cpp: 28 (WebCore::StyledElement::classAttributeChanged): 29 * html/HTMLAnchorElement.cpp: 30 (WebCore::HTMLAnchorElement::parseMappedAttribute): 31 * html/HTMLAppletElement.cpp: 32 (WebCore::HTMLAppletElement::parseMappedAttribute): 33 * html/HTMLElement.cpp: 34 (WebCore::HTMLElement::parseMappedAttribute): 35 * html/HTMLEmbedElement.cpp: 36 (WebCore::HTMLEmbedElement::parseMappedAttribute): 37 * html/HTMLFormElement.cpp: 38 (WebCore::HTMLFormElement::parseMappedAttribute): 39 * html/HTMLFrameElementBase.cpp: 40 (WebCore::HTMLFrameElementBase::parseMappedAttribute): 41 * html/HTMLIFrameElement.cpp: 42 (WebCore::HTMLIFrameElement::parseMappedAttribute): 43 * html/HTMLImageElement.cpp: 44 (WebCore::HTMLImageElement::parseMappedAttribute): 45 * html/HTMLMapElement.cpp: 46 (WebCore::HTMLMapElement::parseMappedAttribute): 47 * html/HTMLMetaElement.cpp: 48 (WebCore::HTMLMetaElement::parseMappedAttribute): 49 * html/HTMLObjectElement.cpp: 50 (WebCore::HTMLObjectElement::parseMappedAttribute): 51 * html/HTMLParamElement.cpp: 52 (WebCore::HTMLParamElement::parseMappedAttribute): 53 1 54 2011-12-16 Andreas Kling <kling@webkit.org> 2 55 -
trunk/Source/WebCore/dom/Attr.cpp
r102814 r103116 127 127 createTextChild(); 128 128 m_ignoreChildrenChanged--; 129 130 invalidateNodeListsCacheAfterAttributeChanged(m_attribute->name()); 129 131 } 130 132 … … 181 183 Node::childrenChanged(changedByParser, beforeChange, afterChange, childCountDelta); 182 184 183 invalidateNodeListsCacheAfterAttributeChanged( );185 invalidateNodeListsCacheAfterAttributeChanged(m_attribute->name()); 184 186 185 187 // FIXME: We should include entity references in the value 186 188 187 189 String val = ""; 188 190 for (Node *n = firstChild(); n; n = n->nextSibling()) { -
trunk/Source/WebCore/dom/Element.cpp
r103017 r103116 698 698 void Element::updateAfterAttributeChanged(Attribute* attr) 699 699 { 700 invalidateNodeListsCacheAfterAttributeChanged(attr->name()); 701 700 702 if (!AXObjectCache::accessibilityEnabled()) 701 703 return; -
trunk/Source/WebCore/dom/NamedNodeMap.cpp
r102814 r103116 265 265 // Because of our updateStyleAttribute() style modification events are never sent at the right time, so don't bother sending them. 266 266 if (attribute->name() != styleAttr) { 267 m_element->invalidateNodeListsCacheAfterAttributeChanged();268 267 m_element->dispatchAttrAdditionEvent(attribute.get()); 269 268 m_element->dispatchSubtreeModifiedEvent(); … … 302 301 } 303 302 if (m_element) { 304 m_element->invalidateNodeListsCacheAfterAttributeChanged();305 303 m_element->dispatchAttrRemovalEvent(attr.get()); 306 304 m_element->dispatchSubtreeModifiedEvent(); -
trunk/Source/WebCore/dom/Node.cpp
r103001 r103116 1021 1021 } 1022 1022 1023 void Node::invalidateNodeListsCacheAfterAttributeChanged( )1023 void Node::invalidateNodeListsCacheAfterAttributeChanged(const QualifiedName& attrName) 1024 1024 { 1025 1025 if (hasRareData() && isAttributeNode()) { … … 1028 1028 data->clearChildNodeListCache(); 1029 1029 } 1030 1031 // This list should be sync'ed with NodeListsNodeData. 1032 if (attrName != classAttr 1033 #if ENABLE(MICRODATA) 1034 && attrName != itemscopeAttr 1035 && attrName != itempropAttr 1036 #endif 1037 && attrName != nameAttr) 1038 return; 1030 1039 1031 1040 if (!treeScope()->hasNodeListCaches()) -
trunk/Source/WebCore/dom/Node.h
r103001 r103116 520 520 void registerDynamicSubtreeNodeList(DynamicSubtreeNodeList*); 521 521 void unregisterDynamicSubtreeNodeList(DynamicSubtreeNodeList*); 522 void invalidateNodeListsCacheAfterAttributeChanged( );522 void invalidateNodeListsCacheAfterAttributeChanged(const QualifiedName&); 523 523 void invalidateNodeListsCacheAfterChildrenChanged(); 524 524 void notifyLocalNodeListsLabelChanged(); -
trunk/Source/WebCore/dom/StyledElement.cpp
r102431 r103116 229 229 attributeMap()->clearClass(); 230 230 setNeedsStyleRecalc(); 231 invalidateNodeListsCacheAfterAttributeChanged();232 231 dispatchSubtreeModifiedEvent(); 233 232 } -
trunk/Source/WebCore/html/HTMLAnchorElement.cpp
r102606 r103116 224 224 } 225 225 invalidateCachedVisitedLinkHash(); 226 } else if (attr->name() == nameAttr) { 227 invalidateNodeListsCacheAfterAttributeChanged(); 228 } else if (attr->name() == titleAttr) { 226 } else if (attr->name() == nameAttr || attr->name() == titleAttr) { 229 227 // Do nothing. 230 228 } else if (attr->name() == relAttr) -
trunk/Source/WebCore/html/HTMLAppletElement.cpp
r102511 r103116 65 65 } 66 66 m_name = newName; 67 invalidateNodeListsCacheAfterAttributeChanged();68 67 } else if (isIdAttributeName(attr->name())) { 69 68 const AtomicString& newId = attr->value(); -
trunk/Source/WebCore/html/HTMLElement.cpp
r102511 r103116 211 211 } else if (equalIgnoringCase(value, "false")) 212 212 addCSSProperty(attr, CSSPropertyWebkitUserDrag, CSSValueNone); 213 } else if (attr->name() == nameAttr) {214 invalidateNodeListsCacheAfterAttributeChanged();215 213 #if ENABLE(MICRODATA) 216 214 } else if (attr->name() == itempropAttr) { -
trunk/Source/WebCore/html/HTMLEmbedElement.cpp
r102983 r103116 119 119 } 120 120 m_name = value; 121 invalidateNodeListsCacheAfterAttributeChanged();122 121 } else 123 122 HTMLPlugInImageElement::parseMappedAttribute(attr); -
trunk/Source/WebCore/html/HTMLFormElement.cpp
r102511 r103116 393 393 } 394 394 m_name = newName; 395 invalidateNodeListsCacheAfterAttributeChanged();396 395 } else 397 396 HTMLElement::parseMappedAttribute(attr); -
trunk/Source/WebCore/html/HTMLFrameElementBase.cpp
r102511 r103116 142 142 } else if (attr->name() == nameAttr) { 143 143 m_frameName = attr->value(); 144 invalidateNodeListsCacheAfterAttributeChanged();145 144 // FIXME: If we are already attached, this doesn't actually change the frame's name. 146 145 // FIXME: If we are already attached, this doesn't check for frame name -
trunk/Source/WebCore/html/HTMLIFrameElement.cpp
r102511 r103116 85 85 } 86 86 m_name = newName; 87 invalidateNodeListsCacheAfterAttributeChanged();88 87 } else if (attr->name() == frameborderAttr) { 89 88 // Frame border doesn't really match the HTML4 spec definition for iframes. It simply adds -
trunk/Source/WebCore/html/HTMLImageElement.cpp
r102511 r103116 142 142 } 143 143 m_name = newName; 144 invalidateNodeListsCacheAfterAttributeChanged();145 144 } else if (isIdAttributeName(attr->name())) { 146 145 const AtomicString& newId = attr->value(); -
trunk/Source/WebCore/html/HTMLMapElement.cpp
r102511 r103116 121 121 treeScope()->addImageMap(this); 122 122 123 if (attrName == nameAttr)124 invalidateNodeListsCacheAfterAttributeChanged();125 123 return; 126 124 } -
trunk/Source/WebCore/html/HTMLMetaElement.cpp
r102511 r103116 50 50 process(); 51 51 else if (attr->name() == nameAttr) { 52 invalidateNodeListsCacheAfterAttributeChanged();52 // Do nothing 53 53 } else 54 54 HTMLElement::parseMappedAttribute(attr); -
trunk/Source/WebCore/html/HTMLObjectElement.cpp
r102983 r103116 123 123 } 124 124 m_name = newName; 125 invalidateNodeListsCacheAfterAttributeChanged();126 125 } else if (attr->name() == borderAttr) 127 126 applyBorderAttribute(attr); -
trunk/Source/WebCore/html/HTMLParamElement.cpp
r102511 r103116 58 58 } else if (attr->name() == nameAttr) { 59 59 m_name = attr->value(); 60 invalidateNodeListsCacheAfterAttributeChanged();61 60 } else if (attr->name() == valueAttr) { 62 61 m_value = attr->value();
Note: See TracChangeset
for help on using the changeset viewer.