WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED WORKSFORME
28866
when you add a new css rule via the web inspector, reload the page, and try again it will not work
https://bugs.webkit.org/show_bug.cgi?id=28866
Summary
when you add a new css rule via the web inspector, reload the page, and try a...
ryankshaw+webkitbugzilla
Reported
2009-08-31 21:31:49 PDT
in the CSS part of the web inspector, when you click the "Double-Click to add" and add a new style (say: "body p") 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'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
Attachments
Add attachment
proposed patch, testcase, etc.
Joseph Pecoraro
Comment 1
2009-09-01 08:35:13 PDT
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'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 "onpageload" or "onrefresh". The idea being (correct me if I am wrong): - A Panel'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.
Timothy Hatcher
Comment 2
2009-09-01 08:57:10 PDT
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.
Nikita Vasilyev
Comment 3
2010-07-11 04:57:21 PDT
Looks like the bug has been fixed by
https://bugs.webkit.org/show_bug.cgi?id=27124
(or something else). I can't reproduce it.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug