Bug 178513 - Support ::before/::after pseudo elements on elements with display:contents
Summary: Support ::before/::after pseudo elements on elements with display:contents
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: CSS (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks: 157477
  Show dependency treegraph
 
Reported: 2017-10-19 07:21 PDT by Antti Koivisto
Modified: 2017-11-13 15:41 PST (History)
5 users (show)

See Also:


Attachments
patch (6.88 KB, patch)
2017-10-19 07:23 PDT, Antti Koivisto
buildbot: commit-queue-
Details | Formatted Diff | Diff
Archive of layout-test-results from ews125 for ios-simulator-wk2 (841.01 KB, application/zip)
2017-10-19 08:35 PDT, Build Bot
no flags Details
patch (9.34 KB, patch)
2017-10-19 12:08 PDT, Antti Koivisto
buildbot: commit-queue-
Details | Formatted Diff | Diff
Archive of layout-test-results from ews121 for ios-simulator-wk2 (25.74 MB, application/zip)
2017-10-19 14:30 PDT, Build Bot
no flags Details
Archive of layout-test-results from ews115 for mac-elcapitan (2.08 MB, application/zip)
2017-10-19 14:43 PDT, Build Bot
no flags Details
Archive of layout-test-results from ews102 for mac-elcapitan (1.18 MB, application/zip)
2017-10-19 14:46 PDT, Build Bot
no flags Details
patch (12.27 KB, patch)
2017-10-19 15:02 PDT, Antti Koivisto
buildbot: commit-queue-
Details | Formatted Diff | Diff
Archive of layout-test-results from ews100 for mac-elcapitan (1.56 MB, application/zip)
2017-10-19 17:14 PDT, Build Bot
no flags Details
Archive of layout-test-results from ews126 for ios-simulator-wk2 (1.57 MB, application/zip)
2017-10-19 17:22 PDT, Build Bot
no flags Details
Archive of layout-test-results from ews114 for mac-elcapitan (2.25 MB, application/zip)
2017-10-19 17:42 PDT, Build Bot
no flags Details
patch (12.36 KB, patch)
2017-10-20 00:13 PDT, Antti Koivisto
rniwa: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Antti Koivisto 2017-10-19 07:21:47 PDT
div { display:contents }
div::after { content: 'foo' }

should work.
Comment 1 Antti Koivisto 2017-10-19 07:23:19 PDT
Created attachment 324225 [details]
patch
Comment 2 Build Bot 2017-10-19 08:35:37 PDT
Comment on attachment 324225 [details]
patch

Attachment 324225 [details] did not pass ios-sim-ews (ios-simulator-wk2):
Output: http://webkit-queues.webkit.org/results/4919908

Number of test failures exceeded the failure limit.
Comment 3 Build Bot 2017-10-19 08:35:38 PDT
Created attachment 324237 [details]
Archive of layout-test-results from ews125 for ios-simulator-wk2

The attached test failures were seen while running run-webkit-tests on the ios-sim-ews.
Bot: ews125  Port: ios-simulator-wk2  Platform: Mac OS X 10.12.6
Comment 4 Antti Koivisto 2017-10-19 12:08:48 PDT
Created attachment 324259 [details]
patch
Comment 5 Build Bot 2017-10-19 14:30:55 PDT
Comment on attachment 324259 [details]
patch

Attachment 324259 [details] did not pass ios-sim-ews (ios-simulator-wk2):
Output: http://webkit-queues.webkit.org/results/4922877

New failing tests:
fast/dom/offset-parent-positioned-and-inline.html
platform/ios/ios/plugin/youtube-flash-plugin-iframe.html
platform/ios/ios/plugin/youtube-flash-plugin-iframe-no-height-or-width.html
security/contentSecurityPolicy/plugins-types-allows-quicktime-plugin-replacement.html
imported/w3c/web-platform-tests/cssom/getComputedStyle-pseudo.html
fast/replaced/replaced-child-of-absolute-with-auto-height.html
security/contentSecurityPolicy/plugins-types-allows-youtube-plugin-replacement.html
compositing/geometry/repaint-foreground-layer.html
Comment 6 Build Bot 2017-10-19 14:30:57 PDT
Created attachment 324290 [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
Comment 7 Build Bot 2017-10-19 14:43:11 PDT
Comment on attachment 324259 [details]
patch

Attachment 324259 [details] did not pass mac-debug-ews (mac):
Output: http://webkit-queues.webkit.org/results/4923397

New failing tests:
fullscreen/full-screen-fixed-pos-parent.html
fast/repaint/text-in-relative-positioned-inline.html
security/contentSecurityPolicy/plugins-types-allows-quicktime-plugin-replacement.html
imported/w3c/web-platform-tests/cssom/getComputedStyle-pseudo.html
security/contentSecurityPolicy/plugins-types-allows-youtube-plugin-replacement.html
security/contentSecurityPolicy/plugins-types-blocks-quicktime-plugin-replacement-without-mime-type.html
fast/forms/select-listbox-focus-displaynone.html
Comment 8 Build Bot 2017-10-19 14:43:13 PDT
Created attachment 324293 [details]
Archive of layout-test-results from ews115 for mac-elcapitan

The attached test failures were seen while running run-webkit-tests on the mac-debug-ews.
Bot: ews115  Port: mac-elcapitan  Platform: Mac OS X 10.11.6
Comment 9 Build Bot 2017-10-19 14:46:44 PDT
Comment on attachment 324259 [details]
patch

Attachment 324259 [details] did not pass mac-ews (mac):
Output: http://webkit-queues.webkit.org/results/4923616

New failing tests:
fullscreen/full-screen-fixed-pos-parent.html
fast/repaint/text-in-relative-positioned-inline.html
security/contentSecurityPolicy/plugins-types-allows-quicktime-plugin-replacement.html
imported/w3c/web-platform-tests/cssom/getComputedStyle-pseudo.html
security/contentSecurityPolicy/plugins-types-allows-youtube-plugin-replacement.html
security/contentSecurityPolicy/plugins-types-blocks-quicktime-plugin-replacement-without-mime-type.html
fast/forms/select-listbox-focus-displaynone.html
Comment 10 Build Bot 2017-10-19 14:46:45 PDT
Created attachment 324295 [details]
Archive of layout-test-results from ews102 for mac-elcapitan

The attached test failures were seen while running run-webkit-tests on the mac-ews.
Bot: ews102  Port: mac-elcapitan  Platform: Mac OS X 10.11.6
Comment 11 Antti Koivisto 2017-10-19 15:02:57 PDT
Created attachment 324299 [details]
patch
Comment 12 Build Bot 2017-10-19 17:14:56 PDT
Comment on attachment 324299 [details]
patch

Attachment 324299 [details] did not pass mac-ews (mac):
Output: http://webkit-queues.webkit.org/results/4925825

New failing tests:
security/contentSecurityPolicy/plugins-types-allows-youtube-plugin-replacement.html
security/contentSecurityPolicy/plugins-types-allows-quicktime-plugin-replacement.html
security/contentSecurityPolicy/plugins-types-blocks-quicktime-plugin-replacement-without-mime-type.html
Comment 13 Build Bot 2017-10-19 17:14:58 PDT
Created attachment 324319 [details]
Archive of layout-test-results from ews100 for mac-elcapitan

The attached test failures were seen while running run-webkit-tests on the mac-ews.
Bot: ews100  Port: mac-elcapitan  Platform: Mac OS X 10.11.6
Comment 14 Build Bot 2017-10-19 17:22:00 PDT
Comment on attachment 324299 [details]
patch

Attachment 324299 [details] did not pass ios-sim-ews (ios-simulator-wk2):
Output: http://webkit-queues.webkit.org/results/4925646

New failing tests:
fast/dom/offset-parent-positioned-and-inline.html
platform/ios/ios/plugin/youtube-flash-plugin-iframe.html
platform/ios/ios/plugin/youtube-flash-plugin-iframe-no-height-or-width.html
security/contentSecurityPolicy/plugins-types-allows-quicktime-plugin-replacement.html
fast/replaced/replaced-child-of-absolute-with-auto-height.html
security/contentSecurityPolicy/plugins-types-allows-youtube-plugin-replacement.html
compositing/geometry/repaint-foreground-layer.html
Comment 15 Build Bot 2017-10-19 17:22:02 PDT
Created attachment 324321 [details]
Archive of layout-test-results from ews126 for ios-simulator-wk2

The attached test failures were seen while running run-webkit-tests on the ios-sim-ews.
Bot: ews126  Port: ios-simulator-wk2  Platform: Mac OS X 10.12.6
Comment 16 Build Bot 2017-10-19 17:42:56 PDT
Comment on attachment 324299 [details]
patch

Attachment 324299 [details] did not pass mac-debug-ews (mac):
Output: http://webkit-queues.webkit.org/results/4926007

New failing tests:
security/contentSecurityPolicy/plugins-types-allows-youtube-plugin-replacement.html
security/contentSecurityPolicy/plugins-types-allows-quicktime-plugin-replacement.html
security/contentSecurityPolicy/plugins-types-blocks-quicktime-plugin-replacement-without-mime-type.html
Comment 17 Build Bot 2017-10-19 17:42:58 PDT
Created attachment 324324 [details]
Archive of layout-test-results from ews114 for mac-elcapitan

The attached test failures were seen while running run-webkit-tests on the mac-debug-ews.
Bot: ews114  Port: mac-elcapitan  Platform: Mac OS X 10.11.6
Comment 18 Antti Koivisto 2017-10-20 00:13:04 PDT
Created attachment 324366 [details]
patch
Comment 19 Ryosuke Niwa 2017-10-20 01:16:44 PDT
Comment on attachment 324366 [details]
patch

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

> Source/WebCore/style/RenderTreePosition.cpp:89
> +    auto initializeStack = [&] {

I think it's cleaner to just have to code instead of creating a closure & calling it immediately.
I thought you were trying to call this lazily or something.

> Source/WebCore/style/RenderTreePosition.cpp:105
> +    auto begin = [&] {

I think begin() doesn't really covey the semantics. Please give it a more descriptive name.
findFirstRendererConsideringBeforePseudoElement?

> Source/WebCore/style/RenderTreePosition.cpp:109
> +                if (host != parentElement)

It's not clear what host != parentElement means.
Maybe you can define a local boolean with a descriptive name or add a one line comment to clarify what it means?

> Source/WebCore/style/RenderTreePosition.cpp:122
> +    auto push = [&] (Element& element) -> RenderElement* {

Can we give this a more descriptive name like pushIfBeforePseudoElementExists?

> Source/WebCore/style/RenderTreePosition.cpp:132
> +    auto pop = [&] (unsigned depth) -> RenderElement* {

Can we call this popUntilAfterPseudoElement or something to make the semantics clear?
pop(it.depth()) looks rather mysterious.
Comment 20 Antti Koivisto 2017-10-20 01:30:12 PDT
https://trac.webkit.org/r223748
Comment 21 Radar WebKit Bug Importer 2017-11-13 15:41:10 PST
<rdar://problem/35517845>