WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
146576
Web Inspector: CSS rule with 2 pseudo-selectors appears twice
https://bugs.webkit.org/show_bug.cgi?id=146576
Summary
Web Inspector: CSS rule with 2 pseudo-selectors appears twice
Nikita Vasilyev
Reported
2015-07-02 23:20:11 PDT
Created
attachment 256079
[details]
[HTML] Reduction Originally reported by
https://twitter.com/toolmantim
. Animated GIF:
https://cloudup.com/idEbO3X5_OS
Attachments
[HTML] Reduction
(75 bytes, text/html)
2015-07-02 23:20 PDT
,
Nikita Vasilyev
no flags
Details
Animated GIF of the problem
(286.46 KB, image/gif)
2015-07-02 23:21 PDT
,
Nikita Vasilyev
no flags
Details
Patch
(2.20 KB, patch)
2015-07-04 17:11 PDT
,
Devin Rousso
no flags
Details
Formatted Diff
Diff
Archive of layout-test-results from ews104 for mac-mavericks-wk2
(574.62 KB, application/zip)
2015-07-04 17:49 PDT
,
Build Bot
no flags
Details
Patch
(2.21 KB, patch)
2015-07-04 17:57 PDT
,
Devin Rousso
no flags
Details
Formatted Diff
Diff
Patch
(2.53 KB, patch)
2015-07-05 00:00 PDT
,
Devin Rousso
no flags
Details
Formatted Diff
Diff
Show Obsolete
(2)
View All
Add attachment
proposed patch, testcase, etc.
Radar WebKit Bug Importer
Comment 1
2015-07-02 23:20:32 PDT
<
rdar://problem/21666285
>
Nikita Vasilyev
Comment 2
2015-07-02 23:21:19 PDT
Created
attachment 256080
[details]
Animated GIF of the problem
Devin Rousso
Comment 3
2015-07-04 11:47:38 PDT
I have a fix for this, but it relies upon
https://bugs.webkit.org/show_bug.cgi?id=145979
, so once that lands I can fix this.
Devin Rousso
Comment 4
2015-07-04 17:11:52 PDT
Created
attachment 256161
[details]
Patch
Timothy Hatcher
Comment 5
2015-07-04 17:15:38 PDT
Comment on
attachment 256161
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=256161&action=review
> Source/WebInspectorUI/UserInterface/Views/RulesStyleDetailsPanel.js:183 > + if (pseudoElementSelectors.length && pseudoElementSelectors.lastValue.selectorText === selectorText) > + continue;
What if the rules have different source locations?
Build Bot
Comment 6
2015-07-04 17:49:32 PDT
Comment on
attachment 256161
[details]
Patch
Attachment 256161
[details]
did not pass mac-wk2-ews (mac-wk2): Output:
http://webkit-queues.appspot.com/results/5429194611752960
New failing tests: platform/mac-wk2/tiled-drawing/scrolling/scroll-snap/scroll-snap-mandatory-mainframe-slow-vertical.html
Build Bot
Comment 7
2015-07-04 17:49:34 PDT
Created
attachment 256163
[details]
Archive of layout-test-results from ews104 for mac-mavericks-wk2 The attached test failures were seen while running run-webkit-tests on the mac-wk2-ews. Bot: ews104 Port: mac-mavericks-wk2 Platform: Mac OS X 10.9.5
Devin Rousso
Comment 8
2015-07-04 17:57:24 PDT
Created
attachment 256164
[details]
Patch
Timothy Hatcher
Comment 9
2015-07-04 18:31:18 PDT
Comment on
attachment 256164
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=256164&action=review
> Source/WebInspectorUI/UserInterface/Views/RulesStyleDetailsPanel.js:182 > + if (pseudoElementSelectors.length && pseudoElementSelectors.lastValue.style.ownerRule.isEqualTo(style.ownerRule))
Wouldn't just preventing duplicates of the same style/ownerRule be enough? Why does the selector need a replace done and compared to others?
Timothy Hatcher
Comment 10
2015-07-04 19:58:03 PDT
Comment on
attachment 256164
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=256164&action=review
>> Source/WebInspectorUI/UserInterface/Views/RulesStyleDetailsPanel.js:182 >> + if (pseudoElementSelectors.length && pseudoElementSelectors.lastValue.style.ownerRule.isEqualTo(style.ownerRule)) > > Wouldn't just preventing duplicates of the same style/ownerRule be enough? Why does the selector need a replace done and compared to others?
Ah-ha, I think I understand now. Per pseudo element, uniqueOrderedStyles is called and it strips duplicates. But that duplicate matching does not happen across pseudo-elements, in the case of a selector like "*::before, *::after" which applies to two pseudo elements. Perhaps the same logic as uniqueOrderedStyles, should be used here? Not just adjacent duplicates, but all duplicates are removed.
Timothy Hatcher
Comment 11
2015-07-04 20:03:47 PDT
Comment on
attachment 256164
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=256164&action=review
>>> Source/WebInspectorUI/UserInterface/Views/RulesStyleDetailsPanel.js:182 >>> + if (pseudoElementSelectors.length && pseudoElementSelectors.lastValue.style.ownerRule.isEqualTo(style.ownerRule)) >> >> Wouldn't just preventing duplicates of the same style/ownerRule be enough? Why does the selector need a replace done and compared to others? > > Ah-ha, I think I understand now. > > Per pseudo element, uniqueOrderedStyles is called and it strips duplicates. But that duplicate matching does not happen across pseudo-elements, in the case of a selector like "*::before, *::after" which applies to two pseudo elements. > > Perhaps the same logic as uniqueOrderedStyles, should be used here? Not just adjacent duplicates, but all duplicates are removed.
One way to do this would be to concat all pseudoElement.orderedStyles together, then use uniqueOrderedStyles. Then loop over that uniqueOrderedStyles result and populate pseudoElementSelectors.
Devin Rousso
Comment 12
2015-07-05 00:00:19 PDT
Created
attachment 256172
[details]
Patch
Timothy Hatcher
Comment 13
2015-07-05 10:35:26 PDT
Comment on
attachment 256172
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=256172&action=review
> Source/WebInspectorUI/UserInterface/Views/RulesStyleDetailsPanel.js:173 > + var pseudoElementsStyle = [];
Nit: pseudoElementStyles would be better, since this is an array.
WebKit Commit Bot
Comment 14
2015-07-05 11:24:46 PDT
Comment on
attachment 256172
[details]
Patch Clearing flags on attachment: 256172 Committed
r186288
: <
http://trac.webkit.org/changeset/186288
>
WebKit Commit Bot
Comment 15
2015-07-05 11:24:51 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