[SCM] WebKit Debian packaging branch, webkit-1.2, updated. upstream/1.1.90-6072-g9a69373

Gustavo Noronha Silva gns at gnome.org
Thu Apr 8 02:24:22 UTC 2010


The following commit has been merged in the webkit-1.2 branch:
commit 55929984eadf3f39dc3f76d6984f76f7b752d97d
Author: bdakin at apple.com <bdakin at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Mon Mar 22 19:36:17 2010 +0000

    Fix for <rdar://problem/7766437> With Web Inspector opened, a crash
    occurs at Webcore:getMatchedCSSRules() when navigating to a
    previous page
    
    Reviewed by Darin Adler.
    
    defaultView() can legitimately by null (as it is in this case), so
    it must be null-checked.
    
    * inspector/InspectorDOMAgent.cpp:
    (WebCore::InspectorDOMAgent::getStyles):
    (WebCore::InspectorDOMAgent::getComputedStyle):
    (WebCore::InspectorDOMAgent::getMatchedCSSRules):
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@56353 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index b747414..a52ecd5 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,19 @@
+2010-03-22  Beth Dakin  <bdakin at apple.com>
+
+        Reviewed by Darin Adler.
+
+        Fix for <rdar://problem/7766437> With Web Inspector opened, a crash 
+        occurs at Webcore:getMatchedCSSRules() when navigating to a 
+        previous page
+
+        defaultView() can legitimately by null (as it is in this case), so 
+        it must be null-checked.
+
+        * inspector/InspectorDOMAgent.cpp:
+        (WebCore::InspectorDOMAgent::getStyles):
+        (WebCore::InspectorDOMAgent::getComputedStyle):
+        (WebCore::InspectorDOMAgent::getMatchedCSSRules):
+
 2010-03-19  Chris Marrin  <cmarrin at apple.com>
 
         Reviewed by Simon Fraser.
diff --git a/WebCore/inspector/InspectorDOMAgent.cpp b/WebCore/inspector/InspectorDOMAgent.cpp
index f366f66..bbadfaf 100644
--- a/WebCore/inspector/InspectorDOMAgent.cpp
+++ b/WebCore/inspector/InspectorDOMAgent.cpp
@@ -690,9 +690,14 @@ void InspectorDOMAgent::getStyles(long callId, long nodeId, bool authorOnly)
         m_frontend->didGetStyles(callId, ScriptValue::undefined());
         return;
     }
-    Element* element = static_cast<Element*>(node);
-
+    
     DOMWindow* defaultView = node->ownerDocument()->defaultView();
+    if (!defaultView) {
+        m_frontend->didGetStyles(callId, ScriptValue::undefined());
+        return;
+    }
+
+    Element* element = static_cast<Element*>(node);
     RefPtr<CSSStyleDeclaration> computedStyle = defaultView->getComputedStyle(element, "");
 
     ScriptObject result = m_frontend->newScriptObject();
@@ -722,9 +727,14 @@ void InspectorDOMAgent::getComputedStyle(long callId, long nodeId)
         m_frontend->didGetComputedStyle(callId, ScriptValue::undefined());
         return;
     }
-    Element* element = static_cast<Element*>(node);
 
     DOMWindow* defaultView = node->ownerDocument()->defaultView();
+    if (!defaultView) {
+        m_frontend->didGetComputedStyle(callId, ScriptValue::undefined());
+        return;
+    }
+
+    Element* element = static_cast<Element*>(node);
     RefPtr<CSSStyleDeclaration> computedStyle = defaultView->getComputedStyle(element, "");
     m_frontend->didGetComputedStyle(callId, buildObjectForStyle(computedStyle.get(), false));
 }
@@ -732,6 +742,9 @@ void InspectorDOMAgent::getComputedStyle(long callId, long nodeId)
 ScriptArray InspectorDOMAgent::getMatchedCSSRules(Element* element, bool authorOnly)
 {
     DOMWindow* defaultView = element->ownerDocument()->defaultView();
+    if (!defaultView)
+        return m_frontend->newScriptArray();
+
     RefPtr<CSSRuleList> matchedRules = defaultView->getMatchedCSSRules(element, "", authorOnly);
     ScriptArray matchedCSSRules = m_frontend->newScriptArray();
     for (unsigned i = 0; matchedRules.get() && i < matchedRules->length(); ++i) {

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list