Changeset 108634 in webkit


Ignore:
Timestamp:
Feb 23, 2012 9:28:33 AM (12 years ago)
Author:
pfeldman@chromium.org
Message:

Web Inspector: add experiment that loads stylesheets as links
https://bugs.webkit.org/show_bug.cgi?id=79340

Reviewed by Timothy Hatcher.

  • inspector/front-end/Settings.js:

(WebInspector.ExperimentsSettings):

  • inspector/front-end/View.js:

(WebInspector.View.prototype._doLoadCSS):

Location:
trunk/Source/WebCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r108629 r108634  
     12012-02-23  Pavel Feldman  <pfeldman@chromium.org>
     2
     3        Web Inspector: add experiment that loads stylesheets as links
     4        https://bugs.webkit.org/show_bug.cgi?id=79340
     5
     6        Reviewed by Timothy Hatcher.
     7
     8        * inspector/front-end/Settings.js:
     9        (WebInspector.ExperimentsSettings):
     10        * inspector/front-end/View.js:
     11        (WebInspector.View.prototype._doLoadCSS):
     12
    1132012-02-23  Adam Roben  <aroben@apple.com>
    214
  • trunk/Source/WebCore/inspector/front-end/Settings.js

    r108502 r108634  
    179179    // FIXME: Enable http/tests/inspector/indexeddb/resources-panel.html when removed from experiments.
    180180    this.showIndexedDB = this._createExperiment("showIndexedDB", "Show IndexedDB in Resources panel");
     181    this.debugCSS = this._createExperiment("debugCSS", "Load CSS via link tags for debugging");
    181182
    182183    this._cleanUpSetting();
  • trunk/Source/WebCore/inspector/front-end/View.js

    r100433 r108634  
    279279        }
    280280
    281         var xhr = new XMLHttpRequest();
    282         xhr.open("GET", cssFile, false);
    283         xhr.send(null);
    284 
    285         styleElement = document.createElement("style");
    286         styleElement.type = "text/css";
    287         styleElement.textContent = xhr.responseText;
     281        if (WebInspector.experimentsSettings.debugCSS.isEnabled()) {
     282            styleElement = document.createElement("link");
     283            styleElement.rel = "stylesheet";
     284            styleElement.type = "text/css";
     285            styleElement.href = cssFile;
     286        } else {
     287            var xhr = new XMLHttpRequest();
     288            xhr.open("GET", cssFile, false);
     289            xhr.send(null);
     290
     291            styleElement = document.createElement("style");
     292            styleElement.type = "text/css";
     293            styleElement.textContent = xhr.responseText;
     294        }
    288295        document.head.insertBefore(styleElement, document.head.firstChild);
    289296
Note: See TracChangeset for help on using the changeset viewer.