Bug 81319 - Web Inspector: Implement the removal of CSS rules
Summary: Web Inspector: Implement the removal of CSS rules
Status: RESOLVED INVALID
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Inspector (Deprecated) (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Enhancement
Assignee: Alexander Pavlov (apavlov)
URL:
Keywords:
Depends on: 84017
Blocks:
  Show dependency treegraph
 
Reported: 2012-03-16 01:42 PDT by Nikita Vasilyev
Modified: 2014-01-26 11:13 PST (History)
13 users (show)

See Also:


Attachments
Patch (51.19 KB, patch)
2012-04-16 07:59 PDT, Alexander Pavlov (apavlov)
no flags Details | Formatted Diff | Diff
Patch (51.25 KB, patch)
2012-04-16 08:46 PDT, Alexander Pavlov (apavlov)
no flags Details | Formatted Diff | Diff
Patch (51.33 KB, patch)
2012-04-16 09:19 PDT, Alexander Pavlov (apavlov)
pfeldman: review-
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Nikita Vasilyev 2012-03-16 01:42:29 PDT
Screencast: http://www.screenr.com/NkN8

Removing a rule added in Styles pane causes an error: "Error during DOMAgent operation: Server error(-32000): DOM Error while querying.". I can reproduce it on every page in WebKit Nightly and Chrome (stable, dev, and canary).
Comment 1 Pavel Feldman 2012-03-16 04:19:24 PDT
Could you please provide step-by-step repro?
Comment 2 Pavel Feldman 2012-03-16 04:22:49 PDT
(In reply to comment #1)
> Could you please provide step-by-step repro?

Oh, missed the attachment, never mind.
Comment 3 Alexander Pavlov (apavlov) 2012-04-16 07:59:08 PDT
Created attachment 137348 [details]
Patch
Comment 4 Early Warning System Bot 2012-04-16 08:15:18 PDT
Comment on attachment 137348 [details]
Patch

Attachment 137348 [details] did not pass qt-wk2-ews (qt):
Output: http://queues.webkit.org/results/12410676
Comment 5 Early Warning System Bot 2012-04-16 08:18:07 PDT
Comment on attachment 137348 [details]
Patch

Attachment 137348 [details] did not pass qt-ews (qt):
Output: http://queues.webkit.org/results/12418084
Comment 6 Build Bot 2012-04-16 08:20:28 PDT
Comment on attachment 137348 [details]
Patch

Attachment 137348 [details] did not pass win-ews (win):
Output: http://queues.webkit.org/results/12416122
Comment 7 Alexander Pavlov (apavlov) 2012-04-16 08:46:49 PDT
Created attachment 137351 [details]
Patch
Comment 8 Build Bot 2012-04-16 09:05:58 PDT
Comment on attachment 137351 [details]
Patch

Attachment 137351 [details] did not pass mac-ews (mac):
Output: http://queues.webkit.org/results/12412409
Comment 9 Alexander Pavlov (apavlov) 2012-04-16 09:19:54 PDT
Created attachment 137352 [details]
Patch
Comment 10 Pavel Feldman 2012-04-18 05:19:37 PDT
Comment on attachment 137352 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=137352&action=review

> Source/WebCore/css/CSSGrammar.y:447
> +    before_ruleset ruleset {

This could be a separate patch with a test.

> Source/WebCore/inspector/InspectorCSSAgent.cpp:471
> +        return m_styleSheet->insertRuleBefore(m_originalRuleString, m_anchorId, m_originalRuleTextRange.start, ec);

This implies that you drop the information about the enabled state.

> Source/WebCore/inspector/InspectorStyleSheet.cpp:63
> +struct RuleNode : public RefCounted<RuleNode> {

As we agreed offline, I'd suggest that you expose the stylesheet structure via the protocol. Otherwise, you logic for insertion of a rule into a given place of the stylesheet is only accessible as an undo operation for the delete rule.