RESOLVED FIXED181640
Support dynamic pseudo-classes on elements with display: contents
https://bugs.webkit.org/show_bug.cgi?id=181640
Summary Support dynamic pseudo-classes on elements with display: contents
Pavel Klimashkin
Reported 2018-01-14 15:56:25 PST
Pseudo-classes don't work on element with display: contents in TP 47, but they should. You can check demo here: https://codepen.io/klimashkin/pen/LepyLb?editors=1100#0 Cells in table should change style on row hover. It works correctly in Firefox and Chrome 65+, but not in Safari TP 47.
Attachments
patch (14.23 KB, patch)
2018-01-23 07:47 PST, Antti Koivisto
ews-watchlist: commit-queue-
Archive of layout-test-results from ews121 for ios-simulator-wk2 (2.11 MB, application/zip)
2018-01-23 09:21 PST, EWS Watchlist
no flags
patch (14.89 KB, patch)
2018-01-23 12:27 PST, Antti Koivisto
no flags
rebased patch (14.56 KB, patch)
2018-11-09 05:09 PST, Antti Koivisto
no flags
Radar WebKit Bug Importer
Comment 1 2018-01-17 18:52:12 PST
Antti Koivisto
Comment 2 2018-01-18 01:37:18 PST
:hover and :active
Antti Koivisto
Comment 3 2018-01-18 01:39:21 PST
The bug here is that hover/active style doesn't get invalidated on display:contents elements.
Antti Koivisto
Comment 4 2018-01-23 07:47:10 PST
EWS Watchlist
Comment 5 2018-01-23 09:21:04 PST
Comment on attachment 332029 [details] patch Attachment 332029 [details] did not pass ios-sim-ews (ios-simulator-wk2): Output: http://webkit-queues.webkit.org/results/6182997 New failing tests: fast/css/display-contents-hover-active.html
EWS Watchlist
Comment 6 2018-01-23 09:21:05 PST
Created attachment 332031 [details] Archive of layout-test-results from ews121 for ios-simulator-wk2 The attached test failures were seen while running run-webkit-tests on the ios-sim-ews. Bot: ews121 Port: ios-simulator-wk2 Platform: Mac OS X 10.12.6
Antti Koivisto
Comment 7 2018-01-23 12:27:54 PST
Alexey
Comment 8 2018-11-08 04:25:53 PST
Hi from 08.11.2018. This bug is still not fixed. Demo: http://jsfiddle.net/6208eox5/ Safari version: 11.1.2 build 13605.3.8
Ryosuke Niwa
Comment 9 2018-11-08 18:46:30 PST
Antti, is this patch still valid? Not sure why we ended up not landing this patch.
Antti Koivisto
Comment 10 2018-11-09 04:30:02 PST
(In reply to Ryosuke Niwa from comment #9) > Antti, is this patch still valid? Not sure why we ended up not landing this > patch. The patch is valid, feel free to review. It was slightly risky to land at that point due to switch to DOM based traversal and then got forgotten. Also I got sidetracked to 181680, :active was broken in general.
Antti Koivisto
Comment 11 2018-11-09 05:09:19 PST
Created attachment 354330 [details] rebased patch
Dean Jackson
Comment 12 2018-11-12 10:13:00 PST
Comment on attachment 354330 [details] rebased patch View in context: https://bugs.webkit.org/attachment.cgi?id=354330&action=review > Source/WebCore/dom/Element.cpp:2920 > + if (!hasRareData()) > + return nullptr; > + auto* style = elementRareData()->computedStyle(); > + if (style && style->display() == DisplayType::Contents) Could you have if (!hasRareData() || !hasDisplayContents()) return nullptr; return elementRareData()->computedStyle(); Either way is fine with me.
Antti Koivisto
Comment 13 2018-11-12 10:34:17 PST
> Could you have > > if (!hasRareData() || !hasDisplayContents()) > return nullptr; > > return elementRareData()->computedStyle(); > > Either way is fine with me. This is slightly more efficient (in principle, meaningless in practice) since hasDisplayContents() needs to fetch the computed style from rare data too.
WebKit Commit Bot
Comment 14 2018-11-12 10:55:26 PST
Comment on attachment 354330 [details] rebased patch Clearing flags on attachment: 354330 Committed r238097: <https://trac.webkit.org/changeset/238097>
WebKit Commit Bot
Comment 15 2018-11-12 10:55:28 PST
All reviewed patches have been landed. Closing bug.
Pavel Klimashkin
Comment 16 2018-11-12 12:29:35 PST
Thanks! In what release that patch will probably land?
Ryosuke Niwa
Comment 17 2018-11-12 15:43:35 PST
(In reply to Pavel Klimashkin from comment #16) > Thanks! In what release that patch will probably land? Unfortunately, Apple does not comment on future produce release plans so we can't say. But you can usually see up-coming fixes & features in Safari Technology Preview way before it gets released to public: https://developer.apple.com/safari/technology-preview/
Note You need to log in before you can comment on or make changes to this bug.