Title: [104404] trunk/Source/WebCore
Revision
104404
Author
[email protected]
Date
2012-01-08 11:22:05 -0800 (Sun, 08 Jan 2012)

Log Message

Don't create style selector in Element::recalcStyleIfNeededAfterAttributeChanged if it doesn't exist
https://bugs.webkit.org/show_bug.cgi?id=75802

Rubber-stamped by Andreas Kling.

Element::recalcStyleIfNeededAfterAttributeChanged shouldn't create style selector for attribute 
check if it doesn't already exist. We are going to need a full style recalc anyway in that case
and the constructed style selector may get throw out again.

* dom/Element.cpp:
(WebCore::Element::recalcStyleIfNeededAfterAttributeChanged):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (104403 => 104404)


--- trunk/Source/WebCore/ChangeLog	2012-01-08 18:05:51 UTC (rev 104403)
+++ trunk/Source/WebCore/ChangeLog	2012-01-08 19:22:05 UTC (rev 104404)
@@ -1,3 +1,17 @@
+2012-01-08  Antti Koivisto  <[email protected]>
+
+        Don't create style selector in Element::recalcStyleIfNeededAfterAttributeChanged if it doesn't exist
+        https://bugs.webkit.org/show_bug.cgi?id=75802
+
+        Rubber-stamped by Andreas Kling.
+
+        Element::recalcStyleIfNeededAfterAttributeChanged shouldn't create style selector for attribute 
+        check if it doesn't already exist. We are going to need a full style recalc anyway in that case
+        and the constructed style selector may get throw out again.
+
+        * dom/Element.cpp:
+        (WebCore::Element::recalcStyleIfNeededAfterAttributeChanged):
+
 2012-01-08  No'am Rosenthal  <[email protected]>
 
         [Qt] Enable CSS_FILTERS in Qt build

Modified: trunk/Source/WebCore/dom/Element.cpp (104403 => 104404)


--- trunk/Source/WebCore/dom/Element.cpp	2012-01-08 18:05:51 UTC (rev 104403)
+++ trunk/Source/WebCore/dom/Element.cpp	2012-01-08 19:22:05 UTC (rev 104404)
@@ -698,9 +698,12 @@
 {
     if (needsStyleRecalc())
         return;
-
-    if (document()->attached() && document()->styleSelector()->hasSelectorForAttribute(attr->name().localName()))
-        setNeedsStyleRecalc();
+    if (!document()->attached())
+        return;
+    CSSStyleSelector* styleSelector = document()->styleSelectorIfExists();
+    if (styleSelector && !styleSelector->hasSelectorForAttribute(attr->name().localName()))
+        return;
+    setNeedsStyleRecalc();
 }
 
 void Element::idAttributeChanged(Attribute* attr)
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to