[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc

apavlov at chromium.org apavlov at chromium.org
Wed Dec 22 11:24:35 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit 71f16a23bea5a0b4a57b8ddf28d897185e5df3c1
Author: apavlov at chromium.org <apavlov at chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Thu Jul 22 13:26:22 2010 +0000

    2010-07-22  Alexander Pavlov  <apavlov at chromium.org>
    
            Reviewed by Pavel Feldman.
    
            Web Inspector: Rename method for CSS rule source range retrieval and fix return object format
            https://bugs.webkit.org/show_bug.cgi?id=42379
    
            WebCore:
            * inspector/Inspector.idl:
            * inspector/InspectorBackend.cpp:
            (WebCore::InspectorBackend::getRuleRanges):
            * inspector/InspectorBackend.h:
            * inspector/InspectorBackend.idl:
            * inspector/InspectorCSSStore.cpp:
            (WebCore::InspectorCSSStore::getRuleRanges):
            * inspector/InspectorCSSStore.h:
            * inspector/InspectorDOMAgent.cpp:
            (WebCore::InspectorDOMAgent::getRuleRanges):
            * inspector/InspectorDOMAgent.h:
            * inspector/front-end/DOMAgent.js:
    
            WebKit/chromium:
            * src/js/InspectorControllerImpl.js:
            (devtools.InspectorBackendImpl):
    
            LayoutTests:
            * inspector/styles-source-offsets.html:
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@63886 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index 4e50f4f..b392e38 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,12 @@
+2010-07-22  Alexander Pavlov  <apavlov at chromium.org>
+
+        Reviewed by Pavel Feldman.
+
+        Web Inspector: Rename method for CSS rule source range retrieval and fix return object format
+        https://bugs.webkit.org/show_bug.cgi?id=42379
+
+        * inspector/styles-source-offsets.html:
+
 2010-07-22  Zoltan Herczeg  <zherczeg at webkit.org>
 
         Reviewed by Nikolas Zimmermann.
diff --git a/LayoutTests/inspector/styles-source-offsets.html b/LayoutTests/inspector/styles-source-offsets.html
index 878602d..2d59972 100644
--- a/LayoutTests/inspector/styles-source-offsets.html
+++ b/LayoutTests/inspector/styles-source-offsets.html
@@ -41,7 +41,7 @@ function frontend_runTest(testController)
                 testController.notifyDone(testController.results);
                 return;
             }
-            InspectorBackend.getRuleRangesForStyleSheetId(WebInspector.Callback.wrap(frontend_ruleRangesReceived.bind(null, testController, parentStyleSheetId, matchedCSSRules)), parentStyleSheetId);
+            InspectorBackend.getRuleRanges(WebInspector.Callback.wrap(frontend_ruleRangesReceived.bind(null, testController, parentStyleSheetId, matchedCSSRules)), parentStyleSheetId);
         }
         InspectorBackend.getStyles(WebInspector.Callback.wrap(stylesCallback.bind(null, testController)), WebInspector.domAgent.document.body.id, true);
     });
@@ -51,7 +51,7 @@ function frontend_ruleRangesReceived(testController, styleSheetId, matchedCSSRul
 {
     for (var i = 0; i < matchedCSSRules.length; ++i) {
         var rule = matchedCSSRules[i];
-        testController.results.push(rule.selectorText + ": [" + ruleRanges[rule.id].bodyRange.start + "-" + ruleRanges[rule.id].bodyRange.end + "]");
+        testController.results.push(rule.selectorText + ": [" + ruleRanges[rule.style.id].bodyRange.start + "-" + ruleRanges[rule.style.id].bodyRange.end + "]");
     }
     InspectorBackend.getStyleSheet(WebInspector.Callback.wrap(frontend_handleStyleSheet.bind(null, testController)), styleSheetId);
 }
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 044d744..181eb34 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,23 @@
+2010-07-22  Alexander Pavlov  <apavlov at chromium.org>
+
+        Reviewed by Pavel Feldman.
+
+        Web Inspector: Rename method for CSS rule source range retrieval and fix return object format
+        https://bugs.webkit.org/show_bug.cgi?id=42379
+
+        * inspector/Inspector.idl:
+        * inspector/InspectorBackend.cpp:
+        (WebCore::InspectorBackend::getRuleRanges):
+        * inspector/InspectorBackend.h:
+        * inspector/InspectorBackend.idl:
+        * inspector/InspectorCSSStore.cpp:
+        (WebCore::InspectorCSSStore::getRuleRanges):
+        * inspector/InspectorCSSStore.h:
+        * inspector/InspectorDOMAgent.cpp:
+        (WebCore::InspectorDOMAgent::getRuleRanges):
+        * inspector/InspectorDOMAgent.h:
+        * inspector/front-end/DOMAgent.js:
+
 2010-07-21  Pavel Feldman  <pfeldman at chromium.org>
 
         Reviewed by Yury Semikhatsky.
diff --git a/WebCore/inspector/Inspector.idl b/WebCore/inspector/Inspector.idl
index 3c96db1..84a56fc 100644
--- a/WebCore/inspector/Inspector.idl
+++ b/WebCore/inspector/Inspector.idl
@@ -127,7 +127,7 @@ module core {
         void getInlineStyle(in long callId, in long nodeId, out Value style);
         void getComputedStyle(in long callId, in long nodeId, out Value style);
         void getStyleSheet(in long callId, in long styleSheetId, out Value styleSheet);
-        void getRuleRangesForStyleSheetId(in long callId, in long styleSheetId);
+        void getRuleRanges(in long callId, in long styleSheetId, out Value ranges);
         void applyStyleText(in long callId, in long styleId, in String styleText, in String propertyName, out boolean success, out Value style, out Array changedProperties);
         void setStyleText(in long callId, in long styleId, in String styleText, out boolean success);
         void setStyleProperty(in long callId, in long styleId, in String name, in String value, out boolean success);
diff --git a/WebCore/inspector/InspectorBackend.cpp b/WebCore/inspector/InspectorBackend.cpp
index 9f71307..5bcc052 100644
--- a/WebCore/inspector/InspectorBackend.cpp
+++ b/WebCore/inspector/InspectorBackend.cpp
@@ -448,10 +448,10 @@ void InspectorBackend::getStyleSheet(long callId, long styleSheetId)
         domAgent->getStyleSheet(callId, styleSheetId);
 }
 
-void InspectorBackend::getRuleRangesForStyleSheetId(long callId, long styleSheetId)
+void InspectorBackend::getRuleRanges(long callId, long styleSheetId)
 {
     if (InspectorDOMAgent* domAgent = inspectorDOMAgent())
-        domAgent->getRuleRangesForStyleSheetId(callId, styleSheetId);
+        domAgent->getRuleRanges(callId, styleSheetId);
 }
 
 void InspectorBackend::applyStyleText(long callId, long styleId, const String& styleText, const String& propertyName)
diff --git a/WebCore/inspector/InspectorBackend.h b/WebCore/inspector/InspectorBackend.h
index 78d34b6..b5f1f16 100644
--- a/WebCore/inspector/InspectorBackend.h
+++ b/WebCore/inspector/InspectorBackend.h
@@ -140,7 +140,7 @@ public:
     void getInlineStyle(long callId, long nodeId);
     void getComputedStyle(long callId, long nodeId);
     void getStyleSheet(long callId, long styleSheetId);
-    void getRuleRangesForStyleSheetId(long callId, long styleSheetId);
+    void getRuleRanges(long callId, long styleSheetId);
     void applyStyleText(long callId, long styleId, const String& styleText, const String& propertyName);
     void setStyleText(long callId, long styleId, const String& cssText);
     void setStyleProperty(long callId, long styleId, const String& name, const String& value);
diff --git a/WebCore/inspector/InspectorBackend.idl b/WebCore/inspector/InspectorBackend.idl
index 3c460a1..5ac61ab 100644
--- a/WebCore/inspector/InspectorBackend.idl
+++ b/WebCore/inspector/InspectorBackend.idl
@@ -117,7 +117,7 @@ module core {
         void getInlineStyle(in long callId, in long nodeId);
         void getComputedStyle(in long callId, in long nodeId);
         void getStyleSheet(in long callId, in long styleSheetId);
-        void getRuleRangesForStyleSheetId(in long callId, in long styleSheetId);
+        void getRuleRanges(in long callId, in long styleSheetId);
         void applyStyleText(in long callId, in long styleId, in DOMString styleText, in DOMString propertyName);
         void setStyleText(in long callId, in long styleId, in DOMString styleText);
         void setStyleProperty(in long callId, in long styleId, in DOMString name, in DOMString value);
diff --git a/WebCore/inspector/InspectorCSSStore.cpp b/WebCore/inspector/InspectorCSSStore.cpp
index 9dffef9..d098230 100644
--- a/WebCore/inspector/InspectorCSSStore.cpp
+++ b/WebCore/inspector/InspectorCSSStore.cpp
@@ -109,13 +109,12 @@ CSSStyleSheet* InspectorCSSStore::inspectorStyleSheet(Document* ownerDocument, b
     return inspectorStyleSheet;
 }
 
-HashMap<long, SourceRange> InspectorCSSStore::getRuleRangesForStyleSheet(CSSStyleSheet* styleSheet)
+HashMap<long, SourceRange> InspectorCSSStore::getRuleRanges(CSSStyleSheet* styleSheet)
 {
     if (!styleSheet)
         return HashMap<long, SourceRange>();
     RefPtr<CSSRuleList> originalRuleList = CSSRuleList::create(styleSheet, false);
     StyleSheetToOffsetsMap::iterator it = m_styleSheetToOffsets.find(styleSheet);
-    HashMap<long, SourceRange> result;
     Vector<SourceRange>* offsetVector = 0;
     if (it == m_styleSheetToOffsets.end()) {
         InspectorResource* resource = m_inspectorController->resourceForURL(styleSheet->finalURL().string());
@@ -139,13 +138,16 @@ HashMap<long, SourceRange> InspectorCSSStore::getRuleRangesForStyleSheet(CSSStyl
         offsetVector = it->second;
     if (!offsetVector)
         return HashMap<long, SourceRange>();
+
     unsigned ruleIndex = 0;
+    HashMap<long, SourceRange> result;
     for (unsigned i = 0, length = styleSheet->length(); i < length; ++i) {
         ASSERT(ruleIndex < offsetVector->size());
         CSSStyleRule* rule = asCSSStyleRule(styleSheet->item(i));
         if (!rule)
             continue;
-        result.set(bindRule(rule), offsetVector->at(ruleIndex));
+        // This maps the style id to the rule body range.
+        result.set(bindStyle(rule->style()), offsetVector->at(ruleIndex));
         ruleIndex++;
     }
     return result;
diff --git a/WebCore/inspector/InspectorCSSStore.h b/WebCore/inspector/InspectorCSSStore.h
index 4b7ef51..4f7df00 100644
--- a/WebCore/inspector/InspectorCSSStore.h
+++ b/WebCore/inspector/InspectorCSSStore.h
@@ -66,7 +66,7 @@ public:
     InspectorCSSStore(InspectorController* inspectorController);
     ~InspectorCSSStore();
     void reset();
-    HashMap<long, SourceRange> getRuleRangesForStyleSheet(CSSStyleSheet*);
+    HashMap<long, SourceRange> getRuleRanges(CSSStyleSheet*);
     CSSStyleDeclaration* styleForId(long styleId);
     CSSStyleSheet* styleSheetForId(long styleSheetId);
     CSSStyleRule* ruleForId(long styleRuleId);
diff --git a/WebCore/inspector/InspectorDOMAgent.cpp b/WebCore/inspector/InspectorDOMAgent.cpp
index e3d1bf5..3a14830 100644
--- a/WebCore/inspector/InspectorDOMAgent.cpp
+++ b/WebCore/inspector/InspectorDOMAgent.cpp
@@ -1075,11 +1075,11 @@ void InspectorDOMAgent::getStyleSheet(long callId, long styleSheetId)
         m_frontend->didGetStyleSheet(callId, InspectorObject::create());
 }
 
-void InspectorDOMAgent::getRuleRangesForStyleSheetId(long callId, long styleSheetId)
+void InspectorDOMAgent::getRuleRanges(long callId, long styleSheetId)
 {
     CSSStyleSheet* styleSheet = cssStore()->styleSheetForId(styleSheetId);
     if (styleSheet && styleSheet->doc()) {
-        HashMap<long, SourceRange> ruleRanges = cssStore()->getRuleRangesForStyleSheet(styleSheet);
+        HashMap<long, SourceRange> ruleRanges = cssStore()->getRuleRanges(styleSheet);
         if (!ruleRanges.size()) {
             m_frontend->didGetStyleSheet(callId, InspectorObject::create());
             return;
@@ -1095,9 +1095,9 @@ void InspectorDOMAgent::getRuleRangesForStyleSheetId(long callId, long styleShee
                 bodyRange->setNumber("end", it->second.second);
             }
         }
-        m_frontend->didGetStyleSheet(callId, result);
+        m_frontend->didGetRuleRanges(callId, result);
     } else
-        m_frontend->didGetStyleSheet(callId, InspectorValue::null());
+        m_frontend->didGetRuleRanges(callId, InspectorValue::null());
 }
 
 void InspectorDOMAgent::getInlineStyle(long callId, long nodeId)
diff --git a/WebCore/inspector/InspectorDOMAgent.h b/WebCore/inspector/InspectorDOMAgent.h
index 5db837b..38b7034 100644
--- a/WebCore/inspector/InspectorDOMAgent.h
+++ b/WebCore/inspector/InspectorDOMAgent.h
@@ -119,7 +119,7 @@ namespace WebCore {
         void getInlineStyle(long callId, long nodeId);
         void getComputedStyle(long callId, long nodeId);
         void getStyleSheet(long callId, long styleSheetId);
-        void getRuleRangesForStyleSheetId(long callId, long styleSheetId);
+        void getRuleRanges(long callId, long styleSheetId);
         void applyStyleText(long callId, long styleId, const String& styleText, const String& propertyName);
         void setStyleText(long callId, long styleId, const String& cssText);
         void setStyleProperty(long callId, long styleId, const String& name, const String& value);
diff --git a/WebCore/inspector/front-end/DOMAgent.js b/WebCore/inspector/front-end/DOMAgent.js
index 07b16b1..bcbe91e 100644
--- a/WebCore/inspector/front-end/DOMAgent.js
+++ b/WebCore/inspector/front-end/DOMAgent.js
@@ -698,6 +698,7 @@ WebInspector.didGetEventListenersForNode = WebInspector.Callback.processCallback
 WebInspector.didGetStyles = WebInspector.Callback.processCallback;
 WebInspector.didGetAllStyles = WebInspector.Callback.processCallback;
 WebInspector.didGetStyleSheet = WebInspector.Callback.processCallback;
+WebInspector.didGetRuleRanges = WebInspector.Callback.processCallback;
 WebInspector.didGetInlineStyle = WebInspector.Callback.processCallback;
 WebInspector.didGetComputedStyle = WebInspector.Callback.processCallback;
 WebInspector.didApplyStyleText = WebInspector.Callback.processCallback;
diff --git a/WebKit/chromium/ChangeLog b/WebKit/chromium/ChangeLog
index 3add956..55d1e70 100644
--- a/WebKit/chromium/ChangeLog
+++ b/WebKit/chromium/ChangeLog
@@ -1,3 +1,13 @@
+2010-07-22  Alexander Pavlov  <apavlov at chromium.org>
+
+        Reviewed by Pavel Feldman.
+
+        Web Inspector: Rename method for CSS rule source range retrieval and fix return object format
+        https://bugs.webkit.org/show_bug.cgi?id=42379
+
+        * src/js/InspectorControllerImpl.js:
+        (devtools.InspectorBackendImpl):
+
 2010-07-21  Pavel Feldman  <pfeldman at chromium.org>
 
         Reviewed by Yury Semikhatsky.
diff --git a/WebKit/chromium/src/js/InspectorControllerImpl.js b/WebKit/chromium/src/js/InspectorControllerImpl.js
index 5ed506a..a795891 100644
--- a/WebKit/chromium/src/js/InspectorControllerImpl.js
+++ b/WebKit/chromium/src/js/InspectorControllerImpl.js
@@ -94,7 +94,7 @@ devtools.InspectorBackendImpl = function()
     this.installInspectorControllerDelegate_("getComputedStyle");
     this.installInspectorControllerDelegate_("getInlineStyle");
     this.installInspectorControllerDelegate_("getStyleSheet");
-    this.installInspectorControllerDelegate_("getRuleRangesForStyleSheetId");
+    this.installInspectorControllerDelegate_("getRuleRanges");
     this.installInspectorControllerDelegate_("applyStyleText");
     this.installInspectorControllerDelegate_("setStyleText");
     this.installInspectorControllerDelegate_("setStyleProperty");

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list