Changeset 65806 in webkit


Ignore:
Timestamp:
Aug 23, 2010 5:49:37 AM (14 years ago)
Author:
pfeldman@chromium.org
Message:

2010-08-23 Pavel Feldman <pfeldman@chromium.org>

Reviewed by Yury Semikhatsky.

Web Inspector: element's css: pseudo-class locations
https://bugs.webkit.org/show_bug.cgi?id=44344

Also contains a drive-by fix for 44301 (gray out read-only).

  • inspector/front-end/StylesSidebarPane.js: (WebInspector.StylesSidebarPane.prototype.update.computedStyleCallback): (WebInspector.StylesSidebarPane.prototype.update): (WebInspector.StylesSidebarPane.prototype._rebuildUpdate): (WebInspector.StylesSidebarPane.prototype._rebuildSectionsForStyleRules): (WebInspector.StylePropertiesSection):
Location:
trunk/WebCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebCore/ChangeLog

    r65804 r65806  
     12010-08-23  Pavel Feldman  <pfeldman@chromium.org>
     2
     3        Reviewed by Yury Semikhatsky.
     4
     5        Web Inspector: element's css: pseudo-class locations
     6        https://bugs.webkit.org/show_bug.cgi?id=44344
     7
     8        Also contains a drive-by fix for 44301 (gray out read-only).
     9
     10        * inspector/front-end/StylesSidebarPane.js:
     11        (WebInspector.StylesSidebarPane.prototype.update.computedStyleCallback):
     12        (WebInspector.StylesSidebarPane.prototype.update):
     13        (WebInspector.StylesSidebarPane.prototype._rebuildUpdate):
     14        (WebInspector.StylesSidebarPane.prototype._rebuildSectionsForStyleRules):
     15        (WebInspector.StylePropertiesSection):
     16
    1172010-08-23  Sheriff Bot  <webkit.review.bot@gmail.com>
    218
  • trunk/WebCore/inspector/front-end/StylesSidebarPane.js

    r62630 r65806  
    144144            if (computedStyle)
    145145                this._refreshUpdate(node, computedStyle, editedSection);
    146         };
     146        }
    147147
    148148        if (refresh)
     
    167167        this.bodyElement.removeChildren();
    168168        this._computedStylePane.bodyElement.removeChildren();
     169
    169170        var styleRules = this._rebuildStyleRules(node, styles);
    170171        var usedProperties = {};
     
    172173        this._markUsedProperties(styleRules, usedProperties, disabledComputedProperties);
    173174        this.sections[0] = this._rebuildSectionsForStyleRules(styleRules, usedProperties, disabledComputedProperties, 0);
     175        var anchorElement = this.sections[0].inheritedPropertiesSeparatorElement;
    174176
    175177        for (var i = 0; i < styles.pseudoElements.length; ++i) {
     
    190192            disabledComputedProperties = {};
    191193            this._markUsedProperties(styleRules, usedProperties, disabledComputedProperties);
    192             this.sections[pseudoId] = this._rebuildSectionsForStyleRules(styleRules, usedProperties, disabledComputedProperties, pseudoId);
     194            this.sections[pseudoId] = this._rebuildSectionsForStyleRules(styleRules, usedProperties, disabledComputedProperties, pseudoId, anchorElement);
    193195        }
    194196    },
     
    243245            var rule = WebInspector.CSSStyleDeclaration.parseRule(styles.matchedCSSRules[i]);
    244246            styleRules.push({ style: rule.style, selectorText: rule.selectorText, parentStyleSheet: rule.parentStyleSheet, rule: rule });
    245         }
    246 
    247         // Collect used properties first in order to identify inherited ones.
    248         var userPropertyNames = {};
    249         for (var i = 0; i < styleRules.length; ++i) {
    250             var styleRule = styleRules[i];
    251             if (styleRule.computedStyle || styleRule.isStyleSeparator)
    252                 continue;
    253             var style = styleRule.style;
    254             for (var j = 0; j < style.length; ++j)
    255                 userPropertyNames[style[j]] = true;
    256247        }
    257248
     
    403394    },
    404395
    405     _rebuildSectionsForStyleRules: function(styleRules, usedProperties, disabledComputedProperties, pseudoId)
     396    _rebuildSectionsForStyleRules: function(styleRules, usedProperties, disabledComputedProperties, pseudoId, anchorElement)
    406397    {
    407398        // Make a property section for each style rule.
     
    417408                    separatorElement.appendChild(document.createTextNode(WebInspector.UIString("Inherited from") + " "));
    418409                    separatorElement.appendChild(link);
     410                    if (!sections.inheritedPropertiesSeparatorElement)
     411                        sections.inheritedPropertiesSeparatorElement = separatorElement;
    419412                } else if ("pseudoId" in styleRule) {
    420413                    var pseudoName = WebInspector.StylesSidebarPane.PseudoIdNames[styleRule.pseudoId];
     
    425418                } else
    426419                    separatorElement.textContent = styleRule.text;
    427                 this.bodyElement.appendChild(separatorElement);
     420                this.bodyElement.insertBefore(separatorElement, anchorElement);
    428421                lastWasSeparator = true;
    429422                continue;
     
    446439                lastWasSeparator = true;
    447440            } else {
    448                 this.bodyElement.appendChild(section.element);
     441                this.bodyElement.insertBefore(section.element, anchorElement);
    449442                lastWasSeparator = false;
    450443            }
     
    678671    if (this.subtitle)
    679672        this.identifier += ":" + this.subtitle;
     673
     674    if (!this.editable)
     675        this.element.addStyleClass("read-only");
    680676}
    681677
  • trunk/WebCore/inspector/front-end/inspector.css

    r64144 r65806  
    40804080}
    40814081
     4082.styles-section.read-only {
     4083    background-color: rgb(240, 240, 240);
     4084}
     4085
    40824086.styles-section .header {
    40834087    white-space: nowrap;
Note: See TracChangeset for help on using the changeset viewer.