Bug 147922

Summary: Web Inspector: Disabling attribute styles should not be possible
Product: WebKit Reporter: Devin Rousso <hi>
Component: Web InspectorAssignee: Devin Rousso <hi>
Status: RESOLVED FIXED    
Severity: Normal CC: bburg, commit-queue, graouts, joepeck, mattbaker, nvasilyev, timothy, webkit-bug-importer
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: All   
OS: All   
Attachments:
Description Flags
Patch
none
Patch none

Description Devin Rousso 2015-08-11 22:05:36 PDT
Currently, clicking a style icon in the Rules panel adds comments around every line in that style to "disable" that rule.  This should not be possible for any type of style other than inline, author, user, inspector, and inherited rules.  Currently, it allows toggling of everything other than UserAgent, but this needs to be changed to the list above.
Comment 1 Devin Rousso 2015-08-11 22:07:24 PDT
Created attachment 258803 [details]
Patch
Comment 2 Timothy Hatcher 2015-08-11 22:10:20 PDT
Comment on attachment 258803 [details]
Patch

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

> Source/WebInspectorUI/UserInterface/Views/CSSStyleDeclarationSection.js:103
> +        if (style.editable && (style.type === WebInspector.CSSStyleDeclaration.Type.Rule || style.type === WebInspector.CSSStyleDeclaration.Type.Inline)

Would style.editable be enough?
Comment 3 Devin Rousso 2015-08-11 22:16:13 PDT
(In reply to comment #2)
> Comment on attachment 258803 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=258803&action=review
> 
> > Source/WebInspectorUI/UserInterface/Views/CSSStyleDeclarationSection.js:103
> > +        if (style.editable && (style.type === WebInspector.CSSStyleDeclaration.Type.Rule || style.type === WebInspector.CSSStyleDeclaration.Type.Inline)
> 
> Would style.editable be enough?

Ha I can't believe I didn't think of that.  It works exactly as described.
Comment 4 Devin Rousso 2015-08-11 22:17:43 PDT
Created attachment 258805 [details]
Patch
Comment 5 WebKit Commit Bot 2015-08-11 22:46:10 PDT
Comment on attachment 258805 [details]
Patch

Clearing flags on attachment: 258805

Committed r188326: <http://trac.webkit.org/changeset/188326>
Comment 6 WebKit Commit Bot 2015-08-11 22:46:13 PDT
All reviewed patches have been landed.  Closing bug.