Bug 64074 - Web Inspector: CSS inspector gets confused about specificity of !important properties
Summary: Web Inspector: CSS inspector gets confused about specificity of !important pr...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Inspector (Deprecated) (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Alexander Pavlov (apavlov)
URL:
Keywords:
: 62656 (view as bug list)
Depends on:
Blocks:
 
Reported: 2011-07-07 01:40 PDT by Pavel Feldman
Modified: 2011-07-14 01:42 PDT (History)
12 users (show)

See Also:


Attachments
[PATCH] Suggested fix (6.86 KB, patch)
2011-07-08 06:45 PDT, Alexander Pavlov (apavlov)
no flags Details | Formatted Diff | Diff
[PATCH] Unnecessary comment removed (6.76 KB, patch)
2011-07-08 06:55 PDT, Alexander Pavlov (apavlov)
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Pavel Feldman 2011-07-07 01:40:11 PDT
<Upstreaming from http://code.google.com/p/chromium/issues/detail?id=88345>

Chrome Version       : 14.0.803.0 (Official Build 90483) dev 
URLs (if applicable) : See attached test case.
Other browsers tested:
  Firefox 3.6.18: OK

What steps will reproduce the problem?
1. Open attached HTML document.
2. Inspect the "I should be green italic" span.
3. Specifically look at which properties have strikethrough.

What is the expected result?

The more specific rule (".outer span.middle.modifier > span") should take precedence over the less specific one. Indeed, WebKit renders this correctly. When inspecting the green span, both properties from the less specific rule should be stricken through.

What happens instead?

The inspector is confused, and shows a strikethrough "color: green !important".

This happens only with !important properties. The font-style property is only there to illustrate this. If you change it to !important (in both rules), it'll exhibit the same wrong behavior.
Comment 1 Alexander Pavlov (apavlov) 2011-07-08 06:45:01 PDT
Created attachment 100114 [details]
[PATCH] Suggested fix
Comment 2 Pavel Feldman 2011-07-08 06:50:36 PDT
Comment on attachment 100114 [details]
[PATCH] Suggested fix

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

> Source/WebCore/inspector/front-end/StylesSidebarPane.js:457
> +            // FIXME: Will same-specificity rules be reported in reverse order (the active one first), too?

Could you check this?
Comment 3 Alexander Pavlov (apavlov) 2011-07-08 06:55:58 PDT
Created attachment 100115 [details]
[PATCH] Unnecessary comment removed
Comment 4 Alexander Pavlov (apavlov) 2011-07-08 06:56:36 PDT
(In reply to comment #2)
> (From update of attachment 100114 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=100114&action=review
> 
> > Source/WebCore/inspector/front-end/StylesSidebarPane.js:457
> > +            // FIXME: Will same-specificity rules be reported in reverse order (the active one first), too?
> 
> Could you check this?

Yes, the code works correctly in this case, too. Sorry about the confusion.
Comment 5 WebKit Review Bot 2011-07-08 07:51:14 PDT
Comment on attachment 100115 [details]
[PATCH] Unnecessary comment removed

Clearing flags on attachment: 100115

Committed r90630: <http://trac.webkit.org/changeset/90630>
Comment 6 WebKit Review Bot 2011-07-08 07:51:18 PDT
All reviewed patches have been landed.  Closing bug.
Comment 7 Alexander Pavlov (apavlov) 2011-07-14 01:42:04 PDT
*** Bug 62656 has been marked as a duplicate of this bug. ***