<?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>28866</bug_id>
          
          <creation_ts>2009-08-31 21:31:49 -0700</creation_ts>
          <short_desc>when you add a new css rule via the web inspector, reload the page, and try again it will not work</short_desc>
          <delta_ts>2010-07-11 04:57:21 -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>WORKSFORME</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>0</everconfirmed>
          <reporter>ryankshaw+webkitbugzilla</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>joepeck</cc>
    
    <cc>me</cc>
    
    <cc>timothy</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>143773</commentid>
    <comment_count>0</comment_count>
    <who name="">ryankshaw+webkitbugzilla</who>
    <bug_when>2009-08-31 21:31:49 -0700</bug_when>
    <thetext>in the CSS part of the web inspector, when you click the &quot;Double-Click to add&quot;  and add a new style (say: &quot;body p&quot;) and set color:red then reload the page and do the exact same thing, it does not work.

In comment https://bugs.webkit.org/show_bug.cgi?id=27124#c13 Timothy Hatcher says this:

I think what is happeneing here is that we have a reference to the style
element we created for the previous page still, so we think we don&apos;t need to
make a new one and just append to the old one in the previous page.

This reference should be cleared in the ElementsPanel reset method.

for more info see:
comment 12 and 13 of
https://bugs.webkit.org/show_bug.cgi?id=27124</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>143901</commentid>
    <comment_count>1</comment_count>
    <who name="Joseph Pecoraro">joepeck</who>
    <bug_when>2009-09-01 08:35:13 -0700</bug_when>
    <thetext>We do still have a reference to the style element, which needs to be cleared:

    delete InjectedScript.stylesheet;

However, there is no safe place to clear this.  The ElementPanel&apos;s constructor does not appear to get rerun on a refresh, only reset(). However, reset() gets called all over the place and making new stylesheets would lose access to deleting old rules.  I have a similar problem with Cookies in the StoragePanel which I alluded to in Bug 27202.

I propose adding a hook for panels names something like &quot;onpageload&quot; or &quot;onrefresh&quot;.  The idea being (correct me if I am wrong):

  - A Panel&apos;s Constructor is run once when the Inspector is first opened
  - populateInterface() is run when ...?
  - reset() is called all over the place without knowledge of new pages
  - onpageload() would be called on navigation (including page refresh)

onpageload() plugs the hole of wanting to do something once per page load such as:

  - Wiping (or Creating) the Injected Stylesheet
  - Adding the Cookies Tree Element once, because it need only be made once

Uglier, but still usable would be providing a flag to reset like reset(isPageLoad) which could be made true on new page loads.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>143908</commentid>
    <comment_count>2</comment_count>
    <who name="Timothy Hatcher">timothy</who>
    <bug_when>2009-09-01 08:57:10 -0700</bug_when>
    <thetext>I guess reset does serve to purposes. It is called when the page loads and when the Inspector is closed. Spliting this into two functions would be fine, but I think the flag on reset is good too.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>249617</commentid>
    <comment_count>3</comment_count>
    <who name="Nikita Vasilyev">me</who>
    <bug_when>2010-07-11 04:57:21 -0700</bug_when>
    <thetext>Looks like the bug has been fixed by https://bugs.webkit.org/show_bug.cgi?id=27124 (or something else). I can&apos;t reproduce it.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>