Bug 140154

Summary: Web Inspector: Expected UserAgent styles to be crossed-out if overridden
Product: WebKit Reporter: Joseph Pecoraro <joepeck>
Component: Web InspectorAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: commit-queue, graouts, joepeck, jonowells, mattbaker, nvasilyev, timothy, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: 528+ (Nightly build)   
Hardware: All   
OS: All   
Attachments:
Description Flags
[PATCH] Proposed Fix none

Description Joseph Pecoraro 2015-01-06 16:01:54 PST
* SUMMARY
In the styles sidebar I expect User Agent styles are never crossed out, even if they are overridden. I would expect them to be crossed out.

* TEST

    <style>
    textarea { background-color: red; }
    textarea { background-color: green; }
    </style>
    <textarea></textarea>

* STEPS TO REPRODUCE
1. Inspect the <textarea> for its background-color
  => style sidebar shows, "green", "red", "white", expected red and white to be crossed out, but "white" was not.

* NOTES
- This is because the UserAgent CSS.CSSProperties are not sent with a "status" field, and are assumed to be anonymous styles that are never treated as overridden. Maybe we should treat them as overridable here.
Comment 1 Radar WebKit Bug Importer 2015-01-06 16:02:33 PST
<rdar://problem/19392325>
Comment 2 Joseph Pecoraro 2015-01-07 22:29:38 PST
Another test case, for HTML Attributes, which were also getting this treatment:

* TEST 2

    <style>body { background-color: red; }</style>
    <body bgColor="blue" style="background-color:green"></body>

* STEPS TO REPRODUCE
1. Inspect <body> for its background-color
  => "blue" from HTML Attribute should be crossed-out (currently it is not)
2. Disable "green" from inline style.
3. Disable "red" from stylesheet.
  => "blue" from HTML Attribute should be enabled
Comment 3 Joseph Pecoraro 2015-01-07 22:32:16 PST
Created attachment 244242 [details]
[PATCH] Proposed Fix
Comment 4 Timothy Hatcher 2015-01-08 03:02:49 PST
Comment on attachment 244242 [details]
[PATCH] Proposed Fix

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

> Source/WebInspectorUI/UserInterface/Models/DOMNodeStyles.js:600
> +            // FIXME: Is this still needed? This includes UserAgent styles and HTML attribute styles.
>              anonymous = true;

We can remove it. I don't remember why I thought it was needed.
Comment 5 WebKit Commit Bot 2015-01-08 03:43:00 PST
Comment on attachment 244242 [details]
[PATCH] Proposed Fix

Clearing flags on attachment: 244242

Committed r178110: <http://trac.webkit.org/changeset/178110>
Comment 6 WebKit Commit Bot 2015-01-08 03:43:03 PST
All reviewed patches have been landed.  Closing bug.