<?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>143433</bug_id>
          
          <creation_ts>2015-04-05 18:16:05 -0700</creation_ts>
          <short_desc>Web Inspector: wrap style class names in WebInspector.StyleClass helper</short_desc>
          <delta_ts>2026-01-12 09:01:39 -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="Brian Burg">burg</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <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>1082998</commentid>
    <comment_count>0</comment_count>
    <who name="Brian Burg">burg</who>
    <bug_when>2015-04-05 18:16:05 -0700</bug_when>
    <thetext>Since we are moving away from long-winded style properties on view constructors, here&apos;s an idea. Given the two following approaches:

this.element.classList.add(&quot;inline-object-foo&quot;)

this.element.classList.add(WebInspector.StyleClass(&quot;inline-object-foo&quot;))

The latter supports tooling to check for bogus style names.

* This could be done mostly at compile-time by cross-checking against identifiers in CSS files.
* Alternatively, in engineering builds we could collate a &quot;style class whitelist&quot; similar to localizedStrings.js. At runtime we do a lookup into the whitelist and log an error if a bogus style class is used. In production builds, use sed to remove the unnecessary lookup.

Thoughts?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1082999</commentid>
    <comment_count>1</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2015-04-05 18:16:32 -0700</bug_when>
    <thetext>&lt;rdar://problem/20429964&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1083075</commentid>
    <comment_count>2</comment_count>
    <who name="Timothy Hatcher">timothy</who>
    <bug_when>2015-04-06 06:02:11 -0700</bug_when>
    <thetext>I wonder if we could just runtime replace this.element.classList.add, remove, etc. to do the check?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1083089</commentid>
    <comment_count>3</comment_count>
    <who name="Brian Burg">burg</who>
    <bug_when>2015-04-06 08:21:20 -0700</bug_when>
    <thetext>(In reply to comment #2)
&gt; I wonder if we could just runtime replace this.element.classList.add,
&gt; remove, etc. to do the check?

Maybe. A benefit of the proposed style which I didn&apos;t list: it makes it possible to trivially grep for all style strings in your favorite text editor.

It is definitely kind of wordy. I think once ES6 modules land, we can debate whether and how to shorten WebInspector.Everything.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>