Title: [104165] trunk/Source/WebCore
Revision
104165
Author
[email protected]
Date
2012-01-05 08:00:06 -0800 (Thu, 05 Jan 2012)

Log Message

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):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (104164 => 104165)


--- trunk/Source/WebCore/ChangeLog	2012-01-05 15:59:13 UTC (rev 104164)
+++ trunk/Source/WebCore/ChangeLog	2012-01-05 16:00:06 UTC (rev 104165)
@@ -1,3 +1,15 @@
+2012-01-05  Ryosuke Niwa  <[email protected]>
+
+        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  <[email protected]>
 
         [EFL] Replace alloca to C++ new placement.

Modified: trunk/Source/WebCore/dom/Element.cpp (104164 => 104165)


--- trunk/Source/WebCore/dom/Element.cpp	2012-01-05 15:59:13 UTC (rev 104164)
+++ trunk/Source/WebCore/dom/Element.cpp	2012-01-05 16:00:06 UTC (rev 104165)
@@ -706,6 +706,9 @@
     
 void Element::recalcStyleIfNeededAfterAttributeChanged(Attribute* attr)
 {
+    if (needsStyleRecalc())
+        return;
+
     if (document()->attached() && document()->styleSelector()->hasSelectorForAttribute(attr->name().localName()))
         setNeedsStyleRecalc();
 }
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to