Changeset 56798 in webkit


Ignore:
Timestamp:
Mar 30, 2010 10:32:44 AM (14 years ago)
Author:
pfeldman@chromium.org
Message:

2010-03-30 Pavel Feldman <pfeldman@chromium.org>

Reviewed by Timothy Hatcher.

Web Inspector: Do not send empty matching rules for pseudo elements to frontend.

https://bugs.webkit.org/show_bug.cgi?id=36834

  • inspector/InspectorDOMAgent.cpp: (WebCore::InspectorDOMAgent::buildArrayForPseudoElements):
  • inspector/front-end/StylesSidebarPane.js: (WebInspector.StylesSidebarPane.prototype._update):
Location:
trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r56796 r56798  
     12010-03-30  Pavel Feldman  <pfeldman@chromium.org>
     2
     3        Reviewed by Timothy Hatcher.
     4
     5        Web Inspector: Do not send empty matching rules for pseudo elements to frontend.
     6
     7        https://bugs.webkit.org/show_bug.cgi?id=36834
     8
     9        * platform/chromium/test_expectations.txt:
     10
    1112010-03-30  Jian Li  <jianli@chromium.org>
    212
  • trunk/LayoutTests/platform/chromium/test_expectations.txt

    r56796 r56798  
    28492849BUG_HAMAJI : fast/repaint/overflow-scroll-body-appear.html = IMAGE+TEXT IMAGE
    28502850BUGWK36807 WIN : http/tests/inspector-enabled/console-log-before-frame-navigation.html = TEXT
    2851 BUGWK36806 WIN : inspector/elements-panel-styles.html = TEXT
    2852 
     2851
  • trunk/WebCore/ChangeLog

    r56795 r56798  
     12010-03-30  Pavel Feldman  <pfeldman@chromium.org>
     2
     3        Reviewed by Timothy Hatcher.
     4
     5        Web Inspector: Do not send empty matching rules for pseudo elements to frontend.
     6
     7        https://bugs.webkit.org/show_bug.cgi?id=36834
     8
     9        * inspector/InspectorDOMAgent.cpp:
     10        (WebCore::InspectorDOMAgent::buildArrayForPseudoElements):
     11        * inspector/front-end/StylesSidebarPane.js:
     12        (WebInspector.StylesSidebarPane.prototype._update):
     13
    1142010-03-30  Dirk Schulze  <krit@webkit.org>
    215
  • trunk/WebCore/inspector/InspectorDOMAgent.cpp

    r56697 r56798  
    882882    for (PseudoId pseudoId = FIRST_PUBLIC_PSEUDOID; pseudoId < AFTER_LAST_INTERNAL_PSEUDOID; pseudoId = static_cast<PseudoId>(pseudoId + 1)) {
    883883        RefPtr<CSSRuleList> matchedRules = selector->pseudoStyleRulesForElement(element, pseudoId, authorOnly);
    884         ScriptArray matchedArray = buildArrayForCSSRules(matchedRules.get());
    885         static_cast<ScriptObject>(matchedArray).set("pseudoId", static_cast<int>(pseudoId));
    886         result.set(counter++, matchedArray);
     884        if (matchedRules && matchedRules->length()) {
     885            ScriptObject pseudoStyles = m_frontend->newScriptObject();
     886            pseudoStyles.set("pseudoId", static_cast<int>(pseudoId));
     887            pseudoStyles.set("rules", buildArrayForCSSRules(matchedRules.get()));
     888            result.set(counter++, pseudoStyles);
     889        }
    887890    }
    888891    return result;
  • trunk/WebCore/inspector/front-end/StylesSidebarPane.js

    r56697 r56798  
    165165            for (var i = 0; i < styles.pseudoElements.length; ++i) {
    166166                var pseudoElementCSSRules = styles.pseudoElements[i];
    167                 if (!pseudoElementCSSRules.length)
    168                         continue;
    169167
    170168                styleRules = [];
    171169                var pseudoId = pseudoElementCSSRules.pseudoId;
     170
    172171                var entry = { isStyleSeparator: true, pseudoId: pseudoId };
    173172                styleRules.push(entry);
    174173
    175174                // Add rules in reverse order to match the cascade order.
    176                 for (var j = pseudoElementCSSRules.length - 1; j >= 0; --j) {
    177                     var rule = WebInspector.CSSStyleDeclaration.parseRule(pseudoElementCSSRules[j]);
     175                for (var j = pseudoElementCSSRules.rules.length - 1; j >= 0; --j) {
     176                    var rule = WebInspector.CSSStyleDeclaration.parseRule(pseudoElementCSSRules.rules[j]);
    178177                    styleRules.push({ style: rule.style, selectorText: rule.selectorText, parentStyleSheet: rule.parentStyleSheet, rule: rule });
    179178                }
Note: See TracChangeset for help on using the changeset viewer.