Title: [134846] trunk/Source/WebCore
Revision
134846
Author
macpher...@chromium.org
Date
2012-11-15 16:13:29 -0800 (Thu, 15 Nov 2012)

Log Message

Make assumptions about m_parentStyle consistent within StyleResolver::applyProperty()
https://bugs.webkit.org/show_bug.cgi?id=101696

Reviewed by Tony Chang.

Most of the code in StyleResolver::applyProperty assumes that isInherit implies that m_parentStyle is available.
This patch ASSERTs that this assumption is correct, and removes the few existing checks to maintain consistency.

No new tests / covered by all existing CSS tests.

* css/StyleResolver.cpp:
(WebCore::StyleResolver::applyProperty):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (134845 => 134846)


--- trunk/Source/WebCore/ChangeLog	2012-11-16 00:12:17 UTC (rev 134845)
+++ trunk/Source/WebCore/ChangeLog	2012-11-16 00:13:29 UTC (rev 134846)
@@ -1,3 +1,18 @@
+2012-11-15  Luke Macpherson   <macpher...@chromium.org>
+
+        Make assumptions about m_parentStyle consistent within StyleResolver::applyProperty()
+        https://bugs.webkit.org/show_bug.cgi?id=101696
+
+        Reviewed by Tony Chang.
+
+        Most of the code in StyleResolver::applyProperty assumes that isInherit implies that m_parentStyle is available.
+        This patch ASSERTs that this assumption is correct, and removes the few existing checks to maintain consistency.
+
+        No new tests / covered by all existing CSS tests.
+
+        * css/StyleResolver.cpp:
+        (WebCore::StyleResolver::applyProperty):
+
 2012-11-15  Kentaro Hara  <hara...@chromium.org>
 
         [V8] Remove redundant $interfaceName from function parameters

Modified: trunk/Source/WebCore/css/StyleResolver.cpp (134845 => 134846)


--- trunk/Source/WebCore/css/StyleResolver.cpp	2012-11-16 00:12:17 UTC (rev 134845)
+++ trunk/Source/WebCore/css/StyleResolver.cpp	2012-11-16 00:13:29 UTC (rev 134846)
@@ -2817,13 +2817,14 @@
     bool isInitial = value->isInitialValue() || (!m_parentNode && value->isInheritedValue());
 
     ASSERT(!isInherit || !isInitial); // isInherit -> !isInitial && isInitial -> !isInherit
+    ASSERT(!isInherit || (m_parentNode && m_parentStyle)); // isInherit -> (m_parentNode && m_parentStyle)
 
     if (!applyPropertyToRegularStyle() && (!applyPropertyToVisitedLinkStyle() || !isValidVisitedLinkProperty(id))) {
         // Limit the properties that can be applied to only the ones honored by :visited.
         return;
     }
 
-    if (isInherit && m_parentStyle && !m_parentStyle->hasExplicitlyInheritedProperties() && !CSSProperty::isInheritedProperty(id))
+    if (isInherit && !m_parentStyle->hasExplicitlyInheritedProperties() && !CSSProperty::isInheritedProperty(id))
         m_parentStyle->setHasExplicitlyInheritedProperties();
 
 #if ENABLE(CSS_VARIABLES)
@@ -2953,8 +2954,7 @@
         }
     case CSSPropertyQuotes:
         if (isInherit) {
-            if (m_parentStyle)
-                m_style->setQuotes(m_parentStyle->quotes());
+            m_style->setQuotes(m_parentStyle->quotes());
             return;
         }
         if (isInitial) {
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to