<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>141599</bug_id>
          
          <creation_ts>2015-02-13 21:53:51 -0800</creation_ts>
          <short_desc>Web Inspector: CSS Report: Unused / dead code</short_desc>
          <delta_ts>2026-01-12 09:08:06 -0800</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>Web Inspector</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>All</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>NEW</bug_status>
          <resolution></resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>InRadar</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Joseph Pecoraro">joepeck</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>benjamin</cc>
    
    <cc>graouts</cc>
    
    <cc>inspector-bugzilla-changes</cc>
    
    <cc>jonowells</cc>
    
    <cc>webkit-bug-importer</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1069136</commentid>
    <comment_count>0</comment_count>
    <who name="Joseph Pecoraro">joepeck</who>
    <bug_when>2015-02-13 21:53:51 -0800</bug_when>
    <thetext>* SUMMARY
CSS Report: Unused / dead code.

When we do Reports, a useful CSS report feature to have would be warning about unused rules, or dead code within stylesheets.

Examples:
- warn about unused rules (could be dead code, or could just not be affecting this page)
- warn about explicitly dead code, overruled within the styles:
  &quot;b{color:red} b{color:blue}&quot; =&gt; the first rule is dead code and can be eliminated
  &quot;.a.b{...} .b.a{...}&quot; =&gt; more complex, but these two selectors match, possible dead code

Doing a quick web search, there are tools that do similar things:
- css-eliminator &lt;https://www.npmjs.com/package/css-eliminator&gt;
- uncss - &lt;http://davidwalsh.name/uncss&gt;
- unused-css - &lt;https://unused-css.com&gt; (I think this actually checks on multiple pages to essentially get code-coverage of a stylesheet across many pages)
- cssess - &lt;http://razorfast.com/2010/11/21/announcing-cssess-the-bookmarklet-that-finds-unused-css-selectors/&gt;
- helium-css - &lt;https://github.com/geuis/helium-css&gt;
- deadweight - &lt;https://github.com/aanand/deadweight&gt;
- CSS Scanner - &lt;http://sourceforge.net/projects/cssscanner/&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1069137</commentid>
    <comment_count>1</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2015-02-13 21:54:04 -0800</bug_when>
    <thetext>&lt;rdar://problem/19837134&gt;</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>