Bug 171984

Summary: Add a RuntimeEnabledFeature for display: contents
Product: WebKit Reporter: Emilio Cobos Álvarez <ecobos>
Component: CSSAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: aperez, buildbot, commit-queue, dbates, jlewis3, koivisto, pvollan, rego, rniwa, ryanhaddad, sam
Priority: P2    
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on: 172443    
Bug Blocks: 172212, 172215    
Attachments:
Description Flags
Patch
none
Archive of layout-test-results from ews104 for mac-elcapitan-wk2
none
Archive of layout-test-results from ews125 for ios-simulator-wk2
none
Patch
none
Patch
none
Patch
none
Archive of layout-test-results from ews101 for mac-elcapitan
none
Archive of layout-test-results from ews114 for mac-elcapitan
none
Patch
none
Archive of layout-test-results from ews101 for mac-elcapitan
none
Archive of layout-test-results from ews112 for mac-elcapitan
none
WIP
none
WIP
none
WIP
none
Patch
none
Patch
none
Archive of layout-test-results from ews104 for mac-elcapitan-wk2
none
Archive of layout-test-results from ews100 for mac-elcapitan
none
Archive of layout-test-results from ews115 for mac-elcapitan
none
Archive of layout-test-results from ews125 for ios-simulator-wk2
none
Patch
none
Archive of layout-test-results from ews106 for mac-elcapitan-wk2
none
Archive of layout-test-results from ews102 for mac-elcapitan
none
Archive of layout-test-results from ews116 for mac-elcapitan
none
Archive of layout-test-results from ews126 for ios-simulator-wk2
none
Patch none

Description Emilio Cobos Álvarez 2017-05-11 12:23:10 PDT
I plan to work on this over the next few weeks.

I've gone through the tests, and the state of display: contents is not great when enabling it to all elements, so I think we should keep it turned off by default (except for <slot>).

I'd want to add a flag for this that is on during testing, but off everywhere else.
Comment 1 Emilio Cobos Álvarez 2017-05-11 12:26:04 PDT
Created attachment 309749 [details]
Patch
Comment 2 Build Bot 2017-05-11 14:00:15 PDT
Comment on attachment 309749 [details]
Patch

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

New failing tests:
imported/w3c/web-platform-tests/innerText/getter.html
Comment 3 Build Bot 2017-05-11 14:00:16 PDT
Created attachment 309778 [details]
Archive of layout-test-results from ews104 for mac-elcapitan-wk2

The attached test failures were seen while running run-webkit-tests on the mac-wk2-ews.
Bot: ews104  Port: mac-elcapitan-wk2  Platform: Mac OS X 10.11.6
Comment 4 Build Bot 2017-05-11 14:02:32 PDT
Comment on attachment 309749 [details]
Patch

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

New failing tests:
imported/w3c/web-platform-tests/innerText/getter.html
Comment 5 Build Bot 2017-05-11 14:02:33 PDT
Created attachment 309779 [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.11.6
Comment 6 Ryosuke Niwa 2017-05-11 14:06:14 PDT
Antti implemented this feature so he should be reviewing your patches related to display: contents.
Comment 7 Emilio Cobos Álvarez 2017-05-11 14:18:53 PDT
Created attachment 309782 [details]
Patch
Comment 8 Emilio Cobos Álvarez 2017-05-11 14:20:24 PDT
(In reply to Ryosuke Niwa from comment #6)
> Antti implemented this feature so he should be reviewing your patches
> related to display: contents.

Sounds good, thanks!
Comment 9 Antti Koivisto 2017-05-11 14:25:55 PDT
One of the first steps should be to import the tests from

https://github.com/w3c/web-platform-tests/tree/master/css/css-display-3
Comment 10 Emilio Cobos Álvarez 2017-05-11 15:25:17 PDT
Created attachment 309796 [details]
Patch
Comment 11 Emilio Cobos Álvarez 2017-05-11 15:28:22 PDT
Created attachment 309797 [details]
Patch
Comment 12 Emilio Cobos Álvarez 2017-05-11 15:30:17 PDT
Err, sorry for the noise, I can't land the patch myself yet. Last version has the "Reviewed by..." line, if somebody could land it for me that'd be awesome.

(In reply to Antti Koivisto from comment #9)
> One of the first steps should be to import the tests from
> 
> https://github.com/w3c/web-platform-tests/tree/master/css/css-display-3

Yeah, I have patches locally for this, which I'll submit for review tomorrow, probably.

Thanks for the review Antti!
Comment 13 Ryosuke Niwa 2017-05-11 16:29:01 PDT
Comment on attachment 309797 [details]
Patch

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

> Source/WebCore/ChangeLog:11
> +        Add a RuntimeEnabledFeature for display: contents, defaulted to false.
> +
> +        The "defaulted to false" is not only because there are spec issues, but because
> +        I ran the WPT suite, and there was a fair amount of crashes and messed render
> +        trees.
> +
> +        https://bugs.webkit.org/show_bug.cgi?id=171984
> +
> +        Reviewed by Antti Koivisto.

Change log here is really messed up.

The bug title should be followed by a bug URL, followed by a blank line, then a long description.
Comment 14 Build Bot 2017-05-11 16:52:43 PDT
Comment on attachment 309797 [details]
Patch

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

New failing tests:
imported/w3c/web-platform-tests/innerText/getter.html
Comment 15 Build Bot 2017-05-11 16:52:45 PDT
Created attachment 309824 [details]
Archive of layout-test-results from ews101 for mac-elcapitan

The attached test failures were seen while running run-webkit-tests on the mac-ews.
Bot: ews101  Port: mac-elcapitan  Platform: Mac OS X 10.11.6
Comment 16 Build Bot 2017-05-11 16:57:05 PDT
Comment on attachment 309797 [details]
Patch

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

New failing tests:
imported/w3c/web-platform-tests/innerText/getter.html
Comment 17 Build Bot 2017-05-11 16:57:06 PDT
Created attachment 309825 [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 Sam Weinig 2017-05-12 12:39:31 PDT
Is there any reason this need to be a RuntimeEnabledFeature rather than a Setting?
Comment 19 Emilio Cobos Álvarez 2017-05-14 03:51:07 PDT
Created attachment 310084 [details]
Patch
Comment 20 Emilio Cobos Álvarez 2017-05-14 03:54:08 PDT
(In reply to Ryosuke Niwa from comment #13)
> Comment on attachment 309797 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=309797&action=review
> 
> > Source/WebCore/ChangeLog:11
> > +        Add a RuntimeEnabledFeature for display: contents, defaulted to false.
> > +
> > +        The "defaulted to false" is not only because there are spec issues, but because
> > +        I ran the WPT suite, and there was a fair amount of crashes and messed render
> > +        trees.
> > +
> > +        https://bugs.webkit.org/show_bug.cgi?id=171984
> > +
> > +        Reviewed by Antti Koivisto.
> 
> Change log here is really messed up.
> 
> The bug title should be followed by a bug URL, followed by a blank line,
> then a long description.

Thanks for the heads-up, prepare-ChangeLog posted the whole git commit description before the url field, and no script complained about it, so I just assumed it was fine. I updated and amended it.

(In reply to Sam Weinig from comment #18)
> Is there any reason this need to be a RuntimeEnabledFeature rather than a
> Setting?

From a quick look RuntimeEnabledFeatures it what's usually used for web features, but happy to change it if there's a good reason to.
Comment 21 Build Bot 2017-05-14 05:02:41 PDT
Comment on attachment 310084 [details]
Patch

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

New failing tests:
imported/w3c/web-platform-tests/innerText/getter.html
Comment 22 Build Bot 2017-05-14 05:02:43 PDT
Created attachment 310085 [details]
Archive of layout-test-results from ews101 for mac-elcapitan

The attached test failures were seen while running run-webkit-tests on the mac-ews.
Bot: ews101  Port: mac-elcapitan  Platform: Mac OS X 10.11.6
Comment 23 Build Bot 2017-05-14 05:15:01 PDT
Comment on attachment 310084 [details]
Patch

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

New failing tests:
imported/w3c/web-platform-tests/innerText/getter.html
Comment 24 Build Bot 2017-05-14 05:15:02 PDT
Created attachment 310086 [details]
Archive of layout-test-results from ews112 for mac-elcapitan

The attached test failures were seen while running run-webkit-tests on the mac-debug-ews.
Bot: ews112  Port: mac-elcapitan  Platform: Mac OS X 10.11.6
Comment 25 Emilio Cobos Álvarez 2017-05-14 07:13:14 PDT
So I have no clue why the test is failing in OSX. I guess the test runner is not picking up the flag?

Presumably I'm missing some WebView.mm bits or something? Not sure how should I proceed given I don't own a Mac. I guess I'll try some more monkey-see-monkey-do based on other preferences, probably I need to add it to the EXPERIMENTAL_FEATURES?

I'll flag for review again once I get it working.
Comment 26 Emilio Cobos Álvarez 2017-05-14 07:15:05 PDT
Oh, and regarding Settings vs. RuntimeEnabledFeatures, it looks to me per [1] that RuntimeEnabledFeatures should be the right place for it, but maybe I'm missing something.

[1]: https://lists.webkit.org/pipermail/webkit-dev/2017-January/028678.html
Comment 27 Emilio Cobos Álvarez 2017-05-14 07:16:32 PDT
Created attachment 310088 [details]
WIP
Comment 28 Emilio Cobos Álvarez 2017-05-14 07:23:39 PDT
Created attachment 310089 [details]
WIP
Comment 29 Emilio Cobos Álvarez 2017-05-14 08:03:51 PDT
Created attachment 310090 [details]
WIP
Comment 30 Emilio Cobos Álvarez 2017-05-14 09:33:57 PDT
Created attachment 310092 [details]
Patch
Comment 31 Emilio Cobos Álvarez 2017-05-14 09:34:42 PDT
Ok, that seemed to help, could I get the patch re-reviewed please?

Thanks a lot in advance!
Comment 32 WebKit Commit Bot 2017-05-17 08:51:45 PDT
Comment on attachment 310092 [details]
Patch

Clearing flags on attachment: 310092

Committed r216974: <http://trac.webkit.org/changeset/216974>
Comment 33 WebKit Commit Bot 2017-05-17 08:51:48 PDT
All reviewed patches have been landed.  Closing bug.
Comment 34 Matt Lewis 2017-05-17 10:53:04 PDT
Reverted r216974 for reason:

Revision caused consistent timeouts on all platforms.

Committed r216981: <http://trac.webkit.org/changeset/216981>
Comment 36 Emilio Cobos Álvarez 2017-05-17 13:44:33 PDT
Thanks for reopening Matt.

I can repro after rebasing my checkout. I've bisected and it's caused by https://trac.webkit.org/changeset/216972/webkit.

I still don't know enough about that code to know whether that's correct or the bug lies somewhere else, but I guess I'll need to come up with a fix...
Comment 37 Emilio Cobos Álvarez 2017-05-17 13:45:27 PDT
Err, I meant https://trac.webkit.org/changeset/216966/webkit
Comment 38 Emilio Cobos Álvarez 2017-05-18 08:11:24 PDT
I'm still debugging it, and it's fascinating.

The change mentioned in the previous comment looks correct to me, and indeed the test passes in isolation. It seems all related to the following <svg> container in the getter.html. If I remove the SVG container (and the svg tests), it just works. If I remove only the svg tests, but I leave the svg container, the second display: contents test times out.
Comment 39 Emilio Cobos Álvarez 2017-05-22 07:35:22 PDT
Created attachment 310869 [details]
Patch
Comment 40 Emilio Cobos Álvarez 2017-05-22 07:40:22 PDT
(In reply to Emilio Cobos Álvarez from comment #39)
> Created attachment 310869 [details]
> Patch

I shouldn't have really uploaded this yet, sorry about that. It's just the same patch rebased, but apparently webkit-patch upload -g HEAD~ (where HEAD~ was the patch for bug 172443) did the wrong thing here.

Anyway this should be good to go if/when bug 172443 lands.
Comment 41 Build Bot 2017-05-22 07:58:38 PDT
Comment on attachment 310869 [details]
Patch

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

Number of test failures exceeded the failure limit.
Comment 42 Build Bot 2017-05-22 07:58:40 PDT
Created attachment 310874 [details]
Archive of layout-test-results from ews104 for mac-elcapitan-wk2

The attached test failures were seen while running run-webkit-tests on the mac-wk2-ews.
Bot: ews104  Port: mac-elcapitan-wk2  Platform: Mac OS X 10.11.6
Comment 43 Build Bot 2017-05-22 08:21:47 PDT
Comment on attachment 310869 [details]
Patch

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

Number of test failures exceeded the failure limit.
Comment 44 Build Bot 2017-05-22 08:21:48 PDT
Created attachment 310878 [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 45 Build Bot 2017-05-22 08:27:00 PDT
Comment on attachment 310869 [details]
Patch

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

Number of test failures exceeded the failure limit.
Comment 46 Build Bot 2017-05-22 08:27:02 PDT
Created attachment 310880 [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 47 Build Bot 2017-05-22 08:45:00 PDT
Comment on attachment 310869 [details]
Patch

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

New failing tests:
fast/forms/input-text-paste-maxlength.html
fast/forms/input-text-maxlength.html
accessibility/ios-simulator/speak-selection-content.html
fast/forms/textarea-maxlength.html
editing/text-iterator/count-matches-in-form.html
editing/text-iterator/find-string-on-flat-tree.html
fast/forms/number/number-validity-badinput.html
fast/forms/input-value-sanitization.html
Comment 48 Build Bot 2017-05-22 08:45:02 PDT
Created attachment 310881 [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.11.6
Comment 49 Emilio Cobos Álvarez 2017-05-22 13:44:29 PDT
Created attachment 310911 [details]
Patch
Comment 50 Build Bot 2017-05-22 14:32:54 PDT
Comment on attachment 310911 [details]
Patch

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

New failing tests:
imported/w3c/web-platform-tests/cssom/getComputedStyle-pseudo.html
Comment 51 Build Bot 2017-05-22 14:32:55 PDT
Created attachment 310921 [details]
Archive of layout-test-results from ews106 for mac-elcapitan-wk2

The attached test failures were seen while running run-webkit-tests on the mac-wk2-ews.
Bot: ews106  Port: mac-elcapitan-wk2  Platform: Mac OS X 10.11.6
Comment 52 Build Bot 2017-05-22 14:47:41 PDT
Comment on attachment 310911 [details]
Patch

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

New failing tests:
imported/w3c/web-platform-tests/cssom/getComputedStyle-pseudo.html
Comment 53 Build Bot 2017-05-22 14:47:43 PDT
Created attachment 310925 [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 54 Build Bot 2017-05-22 15:00:22 PDT
Comment on attachment 310911 [details]
Patch

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

New failing tests:
imported/w3c/web-platform-tests/cssom/getComputedStyle-pseudo.html
Comment 55 Build Bot 2017-05-22 15:00:24 PDT
Created attachment 310928 [details]
Archive of layout-test-results from ews116 for mac-elcapitan

The attached test failures were seen while running run-webkit-tests on the mac-debug-ews.
Bot: ews116  Port: mac-elcapitan  Platform: Mac OS X 10.11.6
Comment 56 Build Bot 2017-05-22 15:15:26 PDT
Comment on attachment 310911 [details]
Patch

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

New failing tests:
imported/w3c/web-platform-tests/cssom/getComputedStyle-pseudo.html
Comment 57 Build Bot 2017-05-22 15:15:27 PDT
Created attachment 310933 [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.11.6
Comment 58 Emilio Cobos Álvarez 2017-05-22 16:35:25 PDT
(In reply to Build Bot from comment #57)
> Created attachment 310933 [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.11.6

Nothing like making your own patch turn red because of a test written by you :-)

(https://github.com/w3c/web-platform-tests/pull/5830)
Comment 59 Emilio Cobos Álvarez 2017-05-22 16:36:37 PDT
Created attachment 310953 [details]
Patch
Comment 60 Emilio Cobos Álvarez 2017-05-23 03:17:10 PDT
Comment on attachment 310953 [details]
Patch

Hi Antti, could I get this re-reviewed/relanded?

This is the same patch as before, just rebased, and with some expectations updated for a newly imported test too.
Comment 61 WebKit Commit Bot 2017-05-23 06:34:49 PDT
Comment on attachment 310953 [details]
Patch

Clearing flags on attachment: 310953

Committed r217273: <http://trac.webkit.org/changeset/217273>
Comment 62 WebKit Commit Bot 2017-05-23 06:34:52 PDT
All reviewed patches have been landed.  Closing bug.
Comment 63 Ryan Haddad 2017-05-23 10:32:18 PDT
(In reply to WebKit Commit Bot from comment #61)
> Comment on attachment 310953 [details]
> Patch
> 
> Clearing flags on attachment: 310953
> 
> Committed r217273: <http://trac.webkit.org/changeset/217273>

It seems that imported/w3c/web-platform-tests/innerText/getter.html is hitting a flaky assertion failure on macOS and iOS after this change:

https://build.webkit.org/results/Apple%20El%20Capitan%20Debug%20WK2%20(Tests)/r217275%20(1295)/results.html
Comment 64 Emilio Cobos Álvarez 2017-05-23 10:45:19 PDT
(In reply to Ryan Haddad from comment #63)
> (In reply to WebKit Commit Bot from comment #61)
> > Comment on attachment 310953 [details]
> > Patch
> > 
> > Clearing flags on attachment: 310953
> > 
> > Committed r217273: <http://trac.webkit.org/changeset/217273>
> 
> It seems that imported/w3c/web-platform-tests/innerText/getter.html is
> hitting a flaky assertion failure on macOS and iOS after this change:
> 
> https://build.webkit.org/results/
> Apple%20El%20Capitan%20Debug%20WK2%20(Tests)/r217275%20(1295)/results.html

Ugh, so that's a |Text| instance being removed, and it seems to be failing the !renderer() assertion, which looks plausible.

I'll try to look into it during the next few days, but I'd prefer not to revert this patch if it's not too much of a priority, because the patch just enables testing support for a feature that is conditionally enabled right now, and all these issues indicate that there are potentially a lot of other related bugs lying around I think.