Changeset 74153 in webkit


Ignore:
Timestamp:
Dec 15, 2010 3:41:22 PM (13 years ago)
Author:
timothy@apple.com
Message:

Fix a regression where the Web Inspector console would be empty
if the Inspector is localized.

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

Reviewed by Joseph Pecoraro.

  • inspector/front-end/ConsoleView.js:

(WebInspector.ConsoleView.createFilterElement): Add a label argument so the UI string
is separate from the classname. Code clean up.
(WebInspector.ConsoleView.prototype.filter): Remove toLowerCase and use string compare.
(WebInspector.ConsoleView): Pass separate classnames and labels to createFilterElement.

Location:
trunk/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebCore/ChangeLog

    r74152 r74153  
     12010-12-15  Timothy Hatcher  <timothy@apple.com>
     2
     3        Fix a regression where the Web Inspector console would be empty
     4        if the Inspector is localized.
     5
     6        https://bugs.webkit.org/show_bug.cgi?id=51145
     7
     8        Reviewed by Joseph Pecoraro.
     9
     10        * inspector/front-end/ConsoleView.js:
     11        (WebInspector.ConsoleView.createFilterElement): Add a label argument so the UI string
     12        is separate from the classname. Code clean up.
     13        (WebInspector.ConsoleView.prototype.filter): Remove toLowerCase and use string compare.
     14        (WebInspector.ConsoleView): Pass separate classnames and labels to createFilterElement.
     15
    1162010-12-15  Simon Fraser  <simon.fraser@apple.com>
    217
  • trunk/WebCore/inspector/front-end/ConsoleView.js

    r73607 r74153  
    6969
    7070    var updateFilterHandler = this._updateFilter.bind(this);
    71     function createFilterElement(category) {
     71    function createFilterElement(category, label) {
    7272        var categoryElement = document.createElement("li");
    7373        categoryElement.category = category;
    74         categoryElement.addStyleClass(categoryElement.category);
     74        categoryElement.className = category;
    7575        categoryElement.addEventListener("click", updateFilterHandler, false);
    76 
    77         var label = category.toString();
    78         categoryElement.appendChild(document.createTextNode(label));
     76        categoryElement.textContent = label;
    7977
    8078        this.filterBarElement.appendChild(categoryElement);
     79
    8180        return categoryElement;
    8281    }
    8382
    84     this.allElement = createFilterElement.call(this, WebInspector.UIString("All"));
     83    this.allElement = createFilterElement.call(this, "all", WebInspector.UIString("All"));
    8584    createDividerElement.call(this);
    86     this.errorElement = createFilterElement.call(this, WebInspector.UIString("Errors"));
    87     this.warningElement = createFilterElement.call(this, WebInspector.UIString("Warnings"));
    88     this.logElement = createFilterElement.call(this, WebInspector.UIString("Logs"));
     85    this.errorElement = createFilterElement.call(this, "errors", WebInspector.UIString("Errors"));
     86    this.warningElement = createFilterElement.call(this, "warnings", WebInspector.UIString("Warnings"));
     87    this.logElement = createFilterElement.call(this, "logs", WebInspector.UIString("Logs"));
    8988
    9089    this.filter(this.allElement, false);
     
    129128        }
    130129
    131         var targetFilterClass = "filter-" + target.category.toLowerCase();
    132 
    133         if (target.category == "All") {
     130        var targetFilterClass = "filter-" + target.category;
     131
     132        if (target.category === "all") {
    134133            if (target.hasStyleClass("selected")) {
    135134                // We can't unselect all, so we break early here
Note: See TracChangeset for help on using the changeset viewer.