⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 91346 in webkit


Ignore:
Timestamp:
Jul 20, 2011, 12:54:08 AM (15 years ago)
Author:
caseq@chromium.org
Message:

Source/WebCore: Add a resourceLink audit formatter to make it possible for devtools
extensions to link to specific lines in HTML/JS/CSS resources from the
audit results panel.

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

Patch by Boris Smus <smus@chromium.org> on 2011-07-20
Reviewed by Yury Semikhatsky.

  • inspector/front-end/AuditFormatters.js: resourceLink implementation
  • inspector/front-end/ExtensionAPI.js: registering resourceLink FormattedValue

LayoutTests: Web Inspector: audit extensions need a way to link directly to resources
https://bugs.webkit.org/show_bug.cgi?id=64315

Patch by Boris Smus <smus@chromium.org> on 2011-07-20
Reviewed by Yury Semikhatsky.

  • inspector/extensions/extensions-audits-expected.txt:
  • inspector/extensions/extensions-audits-api-expected.txt:
  • inspector/extensions/extensions-audits.html:
Location:
trunk
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r91345 r91346  
     12011-07-20  Boris Smus  <smus@chromium.org>
     2
     3        Web Inspector: audit extensions need a way to link directly to resources
     4        https://bugs.webkit.org/show_bug.cgi?id=64315
     5
     6        Reviewed by Yury Semikhatsky.
     7
     8        * inspector/extensions/extensions-audits-expected.txt:
     9        * inspector/extensions/extensions-audits-api-expected.txt:
     10        * inspector/extensions/extensions-audits.html:
     11
    1122011-07-20  tkent@chromium.org  <tkent@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
    213
  • trunk/LayoutTests/inspector/extensions/extensions-audits-api-expected.txt

    r90355 r91346  
    1717    createSnippet : <function>
    1818    createText : <function>
     19    createResourceLink : <function>
    1920    addResult : <function>
    2021    createResult : <function>
  • trunk/LayoutTests/inspector/extensions/extensions-audits-expected.txt

    r81023 r91346  
    2020    return 4;
    2121}
     22         error.html:10
    2223    Passed rule
    2324     this rule always passes ok
  • trunk/LayoutTests/inspector/extensions/extensions-audits.html

    r90355 r91346  
    2121        nestedNode.expanded = true;
    2222        nestedNode.addChild(results.createSnippet("function rand()\n{\n    return 4;\n}"));
     23        nestedNode.addChild(results.createResourceLink('file:///path/to/error.html', 10));
    2324
    2425        results.addResult("Rule with details subtree (1)", "This rule has a lot of details", results.Severity.Warning, node);
  • trunk/Source/WebCore/ChangeLog

    r91345 r91346  
     12011-07-20  Boris Smus  <smus@chromium.org>
     2
     3        Add a resourceLink audit formatter to make it possible for devtools
     4        extensions to link to specific lines in HTML/JS/CSS resources from the
     5        audit results panel.
     6
     7        https://bugs.webkit.org/show_bug.cgi?id=64315
     8
     9        Reviewed by Yury Semikhatsky.
     10
     11        * inspector/front-end/AuditFormatters.js: resourceLink implementation
     12        * inspector/front-end/ExtensionAPI.js: registering resourceLink FormattedValue
     13
     14
    1152011-07-20  Kent Tamura  <tkent@chromium.org>
    216
  • trunk/Source/WebCore/inspector/front-end/AuditFormatters.js

    r81023 r91346  
    8989            a.target = "_blank";
    9090        return a;
     91    },
     92
     93    resourceLink: function(url, line)
     94    {
     95        var title = url.replace(/.*[\/\\]/, "") + ":" + line;
     96        var a = document.createElement("a");
     97        a.href = url;
     98        a.title = url;
     99        a.className = "console-message-url webkit-html-resource-link";
     100        a.setAttribute("line_number", line);
     101        a.setAttribute("preferred_panel", "scripts");
     102        a.textContent = title;
     103        return a;
    91104    }
    92105};
  • trunk/Source/WebCore/inspector/front-end/ExtensionAPI.js

    r90625 r91346  
    291291    this.createSnippet = bind(this._nodeFactory, null, "snippet");
    292292    this.createText = bind(this._nodeFactory, null, "text");
     293    this.createResourceLink = bind(this._nodeFactory, null, "resourceLink");
    293294}
    294295
Note: See TracChangeset for help on using the changeset viewer.