+2012-02-17 Andreas Kling <awesomekling@apple.com>
+
+ Element: Inline style selector and AX invalidation in attributeChanged().
+ <http://webkit.org/b/78888>
+
+ Reviewed by Antti Koivisto.
+
+ Inline the updateAfterAttributeChanged() and recalcStyleIfNeededAfterAttributeChanged()
+ methods into Element::attributeChanged(). They were separated when we needed them in
+ StyledElement::attributeChanged(), but that's no longer the case.
+
+ * dom/Element.cpp:
+ (WebCore::Element::attributeChanged):
+ * dom/Element.h:
+
2012-02-17 David Reveman <reveman@chromium.org>
[Chromium] Texture eviction doesn't show up in traces.
else if (attr->name() == HTMLNames::nameAttr)
setHasName(!attr->isNull());
- recalcStyleIfNeededAfterAttributeChanged(attr);
- updateAfterAttributeChanged(attr);
-}
+ if (!needsStyleRecalc() && document()->attached()) {
+ CSSStyleSelector* styleSelector = document()->styleSelectorIfExists();
+ if (!styleSelector || styleSelector->hasSelectorForAttribute(attr->name().localName()))
+ setNeedsStyleRecalc();
+ }
-void Element::updateAfterAttributeChanged(Attribute* attr)
-{
invalidateNodeListsCacheAfterAttributeChanged(attr->name());
if (!AXObjectCache::accessibilityEnabled())
else if (attrName == aria_invalidAttr)
document()->axObjectCache()->postNotification(renderer(), AXObjectCache::AXInvalidStatusChanged, true);
}
-
-void Element::recalcStyleIfNeededAfterAttributeChanged(Attribute* attr)
-{
- if (needsStyleRecalc())
- return;
- if (!document()->attached())
- return;
- CSSStyleSelector* styleSelector = document()->styleSelectorIfExists();
- if (styleSelector && !styleSelector->hasSelectorForAttribute(attr->name().localName()))
- return;
- setNeedsStyleRecalc();
-}
void Element::idAttributeChanged(Attribute* attr)
{
virtual bool shouldRegisterAsNamedItem() const { return false; }
virtual bool shouldRegisterAsExtraNamedItem() const { return false; }
- // The implementation of Element::attributeChanged() calls the following two functions.
- // They are separated to allow a different flow of control in StyledElement::attributeChanged().
- void recalcStyleIfNeededAfterAttributeChanged(Attribute*);
- void updateAfterAttributeChanged(Attribute*);
-
void idAttributeChanged(Attribute*);
HTMLCollection* ensureCachedHTMLCollection(CollectionType);