Bug 140154 - Web Inspector: Expected UserAgent styles to be crossed-out if overridden
Summary: Web Inspector: Expected UserAgent styles to be crossed-out if overridden
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Inspector (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Nobody
Keywords: InRadar
Depends on:
Reported: 2015-01-06 16:01 PST by Joseph Pecoraro
Modified: 2015-01-08 03:43 PST (History)
8 users (show)

See Also:

[PATCH] Proposed Fix (2.68 KB, patch)
2015-01-07 22:32 PST, Joseph Pecoraro
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Joseph Pecoraro 2015-01-06 16:01:54 PST
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.


    textarea { background-color: red; }
    textarea { background-color: green; }

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.

- 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
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>

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.