Bug 113476 - Web Inspector: [CSS] One rule appears multiple times in sidebar.
Summary: Web Inspector: [CSS] One rule appears multiple times in sidebar.
Status: RESOLVED INVALID
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:
Depends on:
Blocks:
 
Reported: 2013-03-27 22:10 PDT by Eugene Klyuchnikov
Modified: 2013-03-28 01:38 PDT (History)
9 users (show)

See Also:


Attachments
Demo HTML (485 bytes, text/html)
2013-03-27 22:10 PDT, Eugene Klyuchnikov
no flags Details
---- (22.80 KB, image/png)
2013-03-27 22:10 PDT, Eugene Klyuchnikov
no flags Details
Demo screenshot (126.27 KB, image/png)
2013-03-27 22:19 PDT, Eugene Klyuchnikov
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Eugene Klyuchnikov 2013-03-27 22:10:24 PDT
Created attachment 195481 [details]
Demo HTML

In some cases one rule appears several times in sidebar.
Moreover it overrides own values.

See demo HTML and screenshot in attachemts.
Comment 1 Eugene Klyuchnikov 2013-03-27 22:10:59 PDT
Created attachment 195482 [details]
----
Comment 2 Eugene Klyuchnikov 2013-03-27 22:19:43 PDT
Created attachment 195483 [details]
Demo screenshot
Comment 3 Alexander Pavlov (apavlov) 2013-03-28 01:06:31 PDT
I'm not sure if we want to fix this at all (but this opinion is by no means authoritative), since this is what WebCore reports to us, and this is how exactly it performs rule matching. Since 

.a, .b, .c { X }

is equivalent to

.a { X }
.b { X }
.c { X }

and all three selector groups (".a", ".b", ".c") match the selected element independently (notice that all of them are black, not grayed-out), the rule is reported thrice. Moreover, selector groups might have different specificities, so the same rule may get reported in different positions inside the cascade, and this may turn useful sometimes. I believe we might want to eliminate repetitive consecutive matches for the same rule, though.
Comment 4 Eugene Klyuchnikov 2013-03-28 01:38:36 PDT
(In reply to comment #3)
> I'm not sure if we want to fix this at all (but this opinion is by no means authoritative), since this is what WebCore reports to us, and this is how exactly it performs rule matching.

Oh, I see. Thank you for explanation.