<?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>21268</bug_id>
          
          <creation_ts>2008-09-30 22:17:25 -0700</creation_ts>
          <short_desc>CSS file line numbers should be displayed on styles pane</short_desc>
          <delta_ts>2010-03-23 00:52:49 -0700</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 (Deprecated)</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>All</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>InRadar</keywords>
          <priority>P2</priority>
          <bug_severity>Enhancement</bug_severity>
          <target_milestone>---</target_milestone>
          <dependson>36414</dependson>
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Henry Jalonen">henkka</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>aroben</cc>
    
    <cc>bweinstein</cc>
    
    <cc>cell.jason</cc>
    
    <cc>eric</cc>
    
    <cc>greg</cc>
    
    <cc>hyatt</cc>
    
    <cc>joepeck</cc>
    
    <cc>me</cc>
    
    <cc>pfeldman</cc>
    
    <cc>timothy</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>93506</commentid>
    <comment_count>0</comment_count>
    <who name="Henry Jalonen">henkka</who>
    <bug_when>2008-09-30 22:17:25 -0700</bug_when>
    <thetext>This useful feature is present in Firebug and missing from WebKit inspector, which I&apos;m really missing.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>93652</commentid>
    <comment_count>1</comment_count>
    <who name="Timothy Hatcher">timothy</who>
    <bug_when>2008-10-01 20:05:46 -0700</bug_when>
    <thetext>&lt;rdar://problem/6116072&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>93864</commentid>
    <comment_count>2</comment_count>
    <who name="Timothy Hatcher">timothy</who>
    <bug_when>2008-10-03 00:23:59 -0700</bug_when>
    <thetext>*** Bug 21324 has been marked as a duplicate of this bug. ***</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>132567</commentid>
    <comment_count>3</comment_count>
    <who name="Timothy Hatcher">timothy</who>
    <bug_when>2009-07-17 07:18:15 -0700</bug_when>
    <thetext>*** Bug 27362 has been marked as a duplicate of this bug. ***</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>166200</commentid>
    <comment_count>4</comment_count>
    <who name="jasonevers">cell.jason</who>
    <bug_when>2009-11-24 11:34:09 -0800</bug_when>
    <thetext>I also would love this to be implemented. +5</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>166201</commentid>
    <comment_count>5</comment_count>
      <attachid>43793</attachid>
    <who name="jasonevers">cell.jason</who>
    <bug_when>2009-11-24 11:36:47 -0800</bug_when>
    <thetext>Created attachment 43793
Example of CSS Line numbers implementation [screenshot]</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>166203</commentid>
    <comment_count>6</comment_count>
      <attachid>43793</attachid>
    <who name="jasonevers">cell.jason</who>
    <bug_when>2009-11-24 11:37:43 -0800</bug_when>
    <thetext>Comment on attachment 43793
Example of CSS Line numbers implementation [screenshot]

http://img.skitch.com/20091124-rxtwi85rw2um1xiw88ft4be5r8.jpg</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>166237</commentid>
    <comment_count>7</comment_count>
    <who name="Timothy Hatcher">timothy</who>
    <bug_when>2009-11-24 12:19:05 -0800</bug_when>
    <thetext>Out style is file:line.

So: imac.css:144</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>166248</commentid>
    <comment_count>8</comment_count>
    <who name="jasonevers">cell.jason</who>
    <bug_when>2009-11-24 12:32:24 -0800</bug_when>
    <thetext>That format sounds spectacular.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>182095</commentid>
    <comment_count>9</comment_count>
    <who name="Joseph Pecoraro">joepeck</who>
    <bug_when>2010-01-18 18:58:45 -0800</bug_when>
    <thetext>It seems this is a very common request. So I looked things over.
A few thoughts out loud:

  1. The Web Inspector currently gets all its style info
     through public DOM methods. As far as I know, everything
     is available, up to the filename (taken from the href)
     of the Stylesheet. Line numbers however aren&apos;t available.
     
     Would exposing them through the DOM, say in an IDL like
     CSSStyleRule be taboo? I&apos;d like to know the process on
     creating non-standard, but public properties.

  2. Grammar Changes. Currently whitespace is breezed over:
  
      - css/tokenizer.flex has
      
&gt;         [ \t\r\n\f]+            {yyTok = WHITESPACE; return yyTok;}

      - css/CSSGrammar.y has
  
&gt;         %token WHITESPACE SGML_CD

      - css/CSSParser.cpp in CSSParser::lex(void* yylvalWithoutType)

&gt;         switch (token()) {
&gt;         case WHITESPACE:
&gt;         case SGML_CD:
&gt;         case INCLUDES:
&gt;         case DASHMATCH:
&gt;             break;
  
    If we were to quickly add this, we could just have a counter,
    and increment the counter in the lexer however many newlines
    we see in the WHITESPACE (and SGML_CD?) tokens. I have a
    feeling that would probably have an impact performance.
    (Reparsing a string that was already parsed into a token).
    
    An alternative would be breaking WHITESPACE up in the
    tokenizer/grammar. Counting newlines there, and ignoring
    other whitespace as usual. This would (hopefully) ensure the
    text is parsed just once, keeping the performance about
    the same.
    
    Assuming a developer were to try out these approaches, are
    there tools for testing the performance of the CSS parser?
    I noticed some recent work on the JavaScript grammar had
    some tooling for just testing parsing:
    https://bugs.webkit.org/show_bug.cgi?id=32722#c17</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>182318</commentid>
    <comment_count>10</comment_count>
    <who name="Ron Domingue">me</who>
    <bug_when>2010-01-19 10:50:52 -0800</bug_when>
    <thetext>Line numbering provides an efficient way to identify adjustments and errors in CSS.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>202956</commentid>
    <comment_count>11</comment_count>
    <who name="Pavel Feldman">pfeldman</who>
    <bug_when>2010-03-23 00:52:49 -0700</bug_when>
    <thetext>Fixed as a part of 36414</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>43793</attachid>
            <date>2009-11-24 11:36:47 -0800</date>
            <delta_ts>2009-11-24 11:37:43 -0800</delta_ts>
            <desc>Example of CSS Line numbers implementation [screenshot]</desc>
            <filename>url.txt</filename>
            <type>text/plain</type>
            <size>61</size>
            <attacher name="jasonevers">cell.jason</attacher>
            
              <data encoding="base64">aHR0cDovL2ltZy5za2l0Y2guY29tLzIwMDkxMTI0LXJ4dHdpODVydzJ1bTF4aXc4OGZ0NGJlNXI4
LmpwZw==
</data>

          </attachment>
      

    </bug>

</bugzilla>