WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
145979
Web Inspector: Pseudo Styles Ordering and Media Queries
https://bugs.webkit.org/show_bug.cgi?id=145979
Summary
Web Inspector: Pseudo Styles Ordering and Media Queries
Chris Chiera
Reported
2015-06-15 10:16:21 PDT
Created
attachment 254882
[details]
Comparing same file's style rules in chrome and safari This is in regards to Safari 8.1 on 10.11. Filed a bug report with Apple but also posting here. If there is a separate Webkit forum for 8.1 let me know. In the attachment I compared Chrome style web inspector vs Safari 8.1 showing the same style from the same page. Chrome properly shows all the relevant styles without needing to scroll. Where is in Safari, (while aesthetically pretty), the actual first relevant style, section.products .img-pro h3" is at the very bottom. Chrome properly puts those :after/:before at the bottom of the list since it's least relevant. Chrome also shows why there is two by highlighting :after in the first style and highlighting :before in the second style unlike Safari which simply lists the rules twice without any visual difference. Also Chrome is showing the properly media query relevant information where is Safari is not at all.
Attachments
Comparing same file's style rules in chrome and safari
(238.97 KB, image/png)
2015-06-15 10:16 PDT
,
Chris Chiera
no flags
Details
Patch
(5.00 KB, patch)
2015-07-02 21:48 PDT
,
Devin Rousso
no flags
Details
Formatted Diff
Diff
Patch
(5.12 KB, patch)
2015-07-02 21:54 PDT
,
Devin Rousso
no flags
Details
Formatted Diff
Diff
Show Obsolete
(1)
View All
Add attachment
proposed patch, testcase, etc.
Radar WebKit Bug Importer
Comment 1
2015-06-15 10:16:43 PDT
<
rdar://problem/21384292
>
Timothy Hatcher
Comment 2
2015-06-15 12:06:57 PDT
We should do this. Reset rules night is here. Perhaps we should interleave pseudo-styles with other rules. We might be able to use specificity for that ordering.
Timothy Hatcher
Comment 3
2015-06-18 10:31:40 PDT
"Reset rules night is here." -> "Reset rules get us here."
Devin Rousso
Comment 4
2015-07-02 21:48:17 PDT
Created
attachment 256071
[details]
Patch
Devin Rousso
Comment 5
2015-07-02 21:54:57 PDT
Created
attachment 256072
[details]
Patch
Timothy Hatcher
Comment 6
2015-07-03 16:22:38 PDT
Comment on
attachment 256072
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=256072&action=review
> Source/WebInspectorUI/UserInterface/Views/RulesStyleDetailsPanel.js:278 > + if (style.ownerRule.selectorText.includes(pseudoElement.selectorText))
Do you really want includes? Or should this be a prefix or suffix match? Comparing selectors might fail in some cases, like selectors with commas or implicit * (like :before is the same as *:before). The lastMatchingSelector part is confusing to me. Can you explain it more, maybe with a comment.
Devin Rousso
Comment 7
2015-07-04 10:16:23 PDT
I was using includes to allow proper matching with selectors that had commas in them. For example, so div::after would match with body, div, p. I can definitely see that there are a lot of edge cases I haven't taken into account, which is why I made it so that if any pseudo-selector rules are left by the time the first User Agent or inherited rule is listed, all the remaining pseudo-selector rules are printed out. The lastMatchingSelector part is for when multiple rules have the same selector. In this case, the pseudo-selector rule should go after the last rule and not after the first one.
WebKit Commit Bot
Comment 8
2015-07-04 14:45:47 PDT
Comment on
attachment 256072
[details]
Patch Clearing flags on attachment: 256072 Committed
r186282
: <
http://trac.webkit.org/changeset/186282
>
WebKit Commit Bot
Comment 9
2015-07-04 14:45:50 PDT
All reviewed patches have been landed. Closing bug.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug