Title: [98102] trunk/Source/WebCore
Revision
98102
Author
andreas.kl...@nokia.com
Date
2011-10-21 08:43:03 -0700 (Fri, 21 Oct 2011)

Log Message

Simplify CSSStyleRule::setSelectorText().
https://bugs.webkit.org/show_bug.cgi?id=70607

Reviewed by Antti Koivisto.

Remove unnecessary isCSSStyleSheet() check and redundant Document finding
logic (CSSStyleSheet::document() will return the owner node's Document just
like this code would.)

* css/CSSStyleRule.cpp:
(WebCore::CSSStyleRule::setSelectorText):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (98101 => 98102)


--- trunk/Source/WebCore/ChangeLog	2011-10-21 15:15:03 UTC (rev 98101)
+++ trunk/Source/WebCore/ChangeLog	2011-10-21 15:43:03 UTC (rev 98102)
@@ -1,3 +1,17 @@
+2011-10-21  Andreas Kling  <kl...@webkit.org>
+
+        Simplify CSSStyleRule::setSelectorText().
+        https://bugs.webkit.org/show_bug.cgi?id=70607
+
+        Reviewed by Antti Koivisto.
+
+        Remove unnecessary isCSSStyleSheet() check and redundant Document finding
+        logic (CSSStyleSheet::document() will return the owner node's Document just
+        like this code would.)
+
+        * css/CSSStyleRule.cpp:
+        (WebCore::CSSStyleRule::setSelectorText):
+
 2011-10-21  Alejandro G. Castro  <a...@igalia.com>
 
         [cairo] Forward declaration of GraphicsContextState uses class instead of struct

Modified: trunk/Source/WebCore/css/CSSStyleRule.cpp (98101 => 98102)


--- trunk/Source/WebCore/css/CSSStyleRule.cpp	2011-10-21 15:15:03 UTC (rev 98101)
+++ trunk/Source/WebCore/css/CSSStyleRule.cpp	2011-10-21 15:43:03 UTC (rev 98102)
@@ -57,13 +57,10 @@
 void CSSStyleRule::setSelectorText(const String& selectorText)
 {
     Document* doc = 0;
-    StyleSheet* ownerStyleSheet = m_style->parentStyleSheet();
-    if (ownerStyleSheet) {
-        if (ownerStyleSheet->isCSSStyleSheet())
-            doc = static_cast<CSSStyleSheet*>(ownerStyleSheet)->document();
-        if (!doc)
-            doc = ownerStyleSheet->ownerNode() ? ownerStyleSheet->ownerNode()->document() : 0;
-    }
+
+    if (CSSStyleSheet* styleSheet = m_style->parentStyleSheet())
+        doc = styleSheet->document();
+
     if (!doc)
         doc = m_style->node() ? m_style->node()->document() : 0;
 
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to