From f63b84b9eeb60fe5297e31b82d1cf757e6f168e5 Mon Sep 17 00:00:00 2001 From: "kling@webkit.org" Date: Fri, 17 Feb 2012 22:34:16 +0000 Subject: [PATCH] Element: Inline style selector and AX invalidation in attributeChanged(). 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: git-svn-id: http://svn.webkit.org/repository/webkit/trunk@108126 268f45cc-cd09-0410-ab3c-d52691b4dbfc --- Source/WebCore/ChangeLog | 15 +++++++++++++++ Source/WebCore/dom/Element.cpp | 22 +++++----------------- Source/WebCore/dom/Element.h | 5 ----- 3 files changed, 20 insertions(+), 22 deletions(-) diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog index f174a17..c216212 100644 --- a/Source/WebCore/ChangeLog +++ b/Source/WebCore/ChangeLog @@ -1,3 +1,18 @@ +2012-02-17 Andreas Kling + + Element: Inline style selector and AX invalidation in attributeChanged(). + + + 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 [Chromium] Texture eviction doesn't show up in traces. diff --git a/Source/WebCore/dom/Element.cpp b/Source/WebCore/dom/Element.cpp index 4da4a9d..3860540 100644 --- a/Source/WebCore/dom/Element.cpp +++ b/Source/WebCore/dom/Element.cpp @@ -664,12 +664,12 @@ void Element::attributeChanged(Attribute* attr) 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()) @@ -699,18 +699,6 @@ void Element::updateAfterAttributeChanged(Attribute* attr) 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) { diff --git a/Source/WebCore/dom/Element.h b/Source/WebCore/dom/Element.h index 328d266..81c878e 100644 --- a/Source/WebCore/dom/Element.h +++ b/Source/WebCore/dom/Element.h @@ -416,11 +416,6 @@ protected: 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); -- 2.7.4