https://bugs.webkit.org/show_bug.cgi?id=75569
Reviewed by Andreas Kling.
Check needsStyleRecalc() first to avoid unnecessary hash lookups.
* dom/Element.cpp:
(WebCore::Element::recalcStyleIfNeededAfterAttributeChanged):
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@104165
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2012-01-05 Ryosuke Niwa <rniwa@webkit.org>
+
+ DOM Attribute tests on Dromaeo spends 2.7% of time in hasSelectorForAttribute
+ https://bugs.webkit.org/show_bug.cgi?id=75569
+
+ Reviewed by Andreas Kling.
+
+ Check needsStyleRecalc() first to avoid unnecessary hash lookups.
+
+ * dom/Element.cpp:
+ (WebCore::Element::recalcStyleIfNeededAfterAttributeChanged):
+
2012-01-05 Grzegorz Czajkowski <g.czajkowski@samsung.com>
[EFL] Replace alloca to C++ new placement.
void Element::recalcStyleIfNeededAfterAttributeChanged(Attribute* attr)
{
+ if (needsStyleRecalc())
+ return;
+
if (document()->attached() && document()->styleSelector()->hasSelectorForAttribute(attr->name().localName()))
setNeedsStyleRecalc();
}