Title: [217273] trunk
Revision
217273
Author
commit-qu...@webkit.org
Date
2017-05-23 06:34:46 -0700 (Tue, 23 May 2017)

Log Message

Add a RuntimeEnabledFeature for display: contents, defaulted to false.
https://bugs.webkit.org/show_bug.cgi?id=171984

LayoutTests/imported/w3c:

Patch by Emilio Cobos Álvarez <eco...@igalia.com> on 2017-05-22
Reviewed by Antti Koivisto.

* web-platform-tests/innerText/getter-expected.txt:

Source/WebCore:

Patch by Emilio Cobos Álvarez <eco...@igalia.com> on 2017-05-22
Reviewed by Antti Koivisto.

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.

Tests: imported/w3c/web-platform-tests/innerText/getter.html

* css/StyleResolver.cpp:
(WebCore::StyleResolver::adjustRenderStyle):
* page/RuntimeEnabledFeatures.h:
(WebCore::RuntimeEnabledFeatures::setDisplayContentsEnabled):
(WebCore::RuntimeEnabledFeatures::displayContentsEnabled):

Source/WebKit/mac:

Patch by Emilio Cobos Álvarez <eco...@igalia.com> on 2017-05-23
Reviewed by Antti Koivisto.

* WebView/WebPreferenceKeysPrivate.h:
* WebView/WebPreferences.mm:
(+[WebPreferences initialize]):
(-[WebPreferences displayContentsEnabled]):
(-[WebPreferences setDisplayContentsEnabled:]):
* WebView/WebPreferencesPrivate.h:
* WebView/WebView.mm:
(-[WebView _preferencesChanged:]):

Source/WebKit2:

Patch by Emilio Cobos Álvarez <eco...@igalia.com> on 2017-05-23
Reviewed by Antti Koivisto.

* Shared/WebPreferencesDefinitions.h:
* UIProcess/API/C/WKPreferences.cpp:
(WKPreferencesSetDisplayContentsEnabled):
(WKPreferencesGetDisplayContentsEnabled):
* UIProcess/API/C/WKPreferencesRefPrivate.h:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::updatePreferences):

Tools:

Patch by Emilio Cobos Álvarez <eco...@igalia.com> on 2017-05-23
Reviewed by Antti Koivisto.

* DumpRenderTree/mac/DumpRenderTree.mm:
(enableExperimentalFeatures):
* WebKitTestRunner/TestController.cpp:
(WTR::TestController::resetPreferencesToConsistentValues):

Modified Paths

Diff

Modified: trunk/LayoutTests/imported/w3c/ChangeLog (217272 => 217273)


--- trunk/LayoutTests/imported/w3c/ChangeLog	2017-05-23 07:37:42 UTC (rev 217272)
+++ trunk/LayoutTests/imported/w3c/ChangeLog	2017-05-23 13:34:46 UTC (rev 217273)
@@ -1,3 +1,12 @@
+2017-05-22 Emilio Cobos Álvarez  <eco...@igalia.com>
+
+        Add a RuntimeEnabledFeature for display: contents, defaulted to false.
+        https://bugs.webkit.org/show_bug.cgi?id=171984
+
+        Reviewed by Antti Koivisto.
+
+        * web-platform-tests/innerText/getter-expected.txt:
+
 2017-05-22  youenn fablet  <you...@apple.com>
 
         Resync web-platform-tests up to 8df7c9c215678328212f232ce0b5270c505a8563

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/cssom/getComputedStyle-pseudo-expected.txt (217272 => 217273)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/cssom/getComputedStyle-pseudo-expected.txt	2017-05-23 07:37:42 UTC (rev 217272)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/cssom/getComputedStyle-pseudo-expected.txt	2017-05-23 13:34:46 UTC (rev 217273)
@@ -1,4 +1,4 @@
 
 PASS Resolution of width is correct for ::before and ::after pseudo-elements 
-PASS Resolution of width is correct for ::before and ::after pseudo-elements of display: contents elements 
+FAIL Resolution of width is correct for ::before and ::after pseudo-elements of display: contents elements assert_equals: expected "50px" but got "auto"
 

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/innerText/getter-expected.txt (217272 => 217273)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/innerText/getter-expected.txt	2017-05-23 07:37:42 UTC (rev 217272)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/innerText/getter-expected.txt	2017-05-23 13:34:46 UTC (rev 217273)
@@ -51,9 +51,9 @@
 PASS display:none child of svg ("<div style='display:none' id='target'>abc") 
 PASS child of display:none child of svg ("<div style='display:none'><div id='target'>abc") 
 PASS display:contents container ("<div style='display:contents'>abc") 
-PASS display:contents container ("<div><div style='display:contents'>abc") 
+FAIL display:contents container ("<div><div style='display:contents'>abc") assert_equals: expected "abc" but got "abc\n"
 PASS display:contents rendered ("<div>123<span style='display:contents'>abc") 
-PASS display:contents not processed via textContent ("<div style='display:contents'>   ") 
+FAIL display:contents not processed via textContent ("<div style='display:contents'>   ") assert_equals: expected "" but got "   "
 PASS display:contents not processed via textContent ("<div><div style='display:contents'>   ") 
 PASS visibility:hidden container ("<div style='visibility:hidden'>abc") 
 PASS visibility:hidden child not rendered ("<div>123<span style='visibility:hidden'>abc") 

Modified: trunk/Source/WebCore/ChangeLog (217272 => 217273)


--- trunk/Source/WebCore/ChangeLog	2017-05-23 07:37:42 UTC (rev 217272)
+++ trunk/Source/WebCore/ChangeLog	2017-05-23 13:34:46 UTC (rev 217273)
@@ -1,3 +1,22 @@
+2017-05-22 Emilio Cobos Álvarez  <eco...@igalia.com>
+
+        Add a RuntimeEnabledFeature for display: contents, defaulted to false.
+        https://bugs.webkit.org/show_bug.cgi?id=171984
+
+        Reviewed by Antti Koivisto.
+
+        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.
+
+        Tests: imported/w3c/web-platform-tests/innerText/getter.html
+
+        * css/StyleResolver.cpp:
+        (WebCore::StyleResolver::adjustRenderStyle):
+        * page/RuntimeEnabledFeatures.h:
+        (WebCore::RuntimeEnabledFeatures::setDisplayContentsEnabled):
+        (WebCore::RuntimeEnabledFeatures::displayContentsEnabled):
+
 2017-05-22  Myles C. Maxfield  <mmaxfi...@apple.com>
 
         Update font-style's implementation in the font selection algorithm

Modified: trunk/Source/WebCore/css/StyleResolver.cpp (217272 => 217273)


--- trunk/Source/WebCore/css/StyleResolver.cpp	2017-05-23 07:37:42 UTC (rev 217272)
+++ trunk/Source/WebCore/css/StyleResolver.cpp	2017-05-23 13:34:46 UTC (rev 217273)
@@ -105,6 +105,7 @@
 #include "RenderTheme.h"
 #include "RenderView.h"
 #include "RuleSet.h"
+#include "RuntimeEnabledFeatures.h"
 #include "SVGDocument.h"
 #include "SVGDocumentExtensions.h"
 #include "SVGFontFaceElement.h"
@@ -795,7 +796,7 @@
 
     if (style.display() == CONTENTS) {
         // FIXME: Enable for all elements.
-        bool elementSupportsDisplayContents = is<HTMLSlotElement>(element);
+        bool elementSupportsDisplayContents = is<HTMLSlotElement>(element) || RuntimeEnabledFeatures::sharedFeatures().displayContentsEnabled();
         if (!elementSupportsDisplayContents)
             style.setDisplay(INLINE);
     }

Modified: trunk/Source/WebCore/page/RuntimeEnabledFeatures.h (217272 => 217273)


--- trunk/Source/WebCore/page/RuntimeEnabledFeatures.h	2017-05-23 07:37:42 UTC (rev 217272)
+++ trunk/Source/WebCore/page/RuntimeEnabledFeatures.h	2017-05-23 13:34:46 UTC (rev 217273)
@@ -43,6 +43,9 @@
 class RuntimeEnabledFeatures {
     WTF_MAKE_NONCOPYABLE(RuntimeEnabledFeatures);
 public:
+    void setDisplayContentsEnabled(bool isEnabled) { m_isDisplayContentsEnabled = isEnabled; }
+    bool displayContentsEnabled() const { return m_isDisplayContentsEnabled; }
+
     void setLinkPreloadEnabled(bool isEnabled) { m_isLinkPreloadEnabled = isEnabled; }
     bool linkPreloadEnabled() const { return m_isLinkPreloadEnabled; }
 
@@ -213,6 +216,7 @@
     bool m_isInteractiveFormValidationEnabled { false };
     bool m_isCredentialManagementEnabled { false };
 
+    bool m_isDisplayContentsEnabled { false };
     bool m_isShadowDOMEnabled { true };
     bool m_areCustomElementsEnabled { true };
     bool m_inputEventsEnabled { true };

Modified: trunk/Source/WebKit/mac/ChangeLog (217272 => 217273)


--- trunk/Source/WebKit/mac/ChangeLog	2017-05-23 07:37:42 UTC (rev 217272)
+++ trunk/Source/WebKit/mac/ChangeLog	2017-05-23 13:34:46 UTC (rev 217273)
@@ -1,3 +1,19 @@
+2017-05-23  Emilio Cobos Álvarez  <eco...@igalia.com>
+
+        Add a RuntimeEnabledFeature for display: contents, defaulted to false.
+        https://bugs.webkit.org/show_bug.cgi?id=171984
+
+        Reviewed by Antti Koivisto.
+
+        * WebView/WebPreferenceKeysPrivate.h:
+        * WebView/WebPreferences.mm:
+        (+[WebPreferences initialize]):
+        (-[WebPreferences displayContentsEnabled]):
+        (-[WebPreferences setDisplayContentsEnabled:]):
+        * WebView/WebPreferencesPrivate.h:
+        * WebView/WebView.mm:
+        (-[WebView _preferencesChanged:]):
+
 2017-05-22  Youenn Fablet  <you...@apple.com>
 
         Remove AVAudioCaptureSource

Modified: trunk/Source/WebKit/mac/WebView/WebPreferenceKeysPrivate.h (217272 => 217273)


--- trunk/Source/WebKit/mac/WebView/WebPreferenceKeysPrivate.h	2017-05-23 07:37:42 UTC (rev 217272)
+++ trunk/Source/WebKit/mac/WebView/WebPreferenceKeysPrivate.h	2017-05-23 13:34:46 UTC (rev 217273)
@@ -233,5 +233,6 @@
 #define WebKitMediaCaptureRequiresSecureConnectionPreferenceKey @"WebKitMediaCaptureRequiresSecureConnection"
 #define WebKitAttachmentElementEnabledPreferenceKey @"WebKitAttachmentElementEnabled"
 #define WebKitIntersectionObserverEnabledPreferenceKey @"WebKitIntersectionObserverEnabled"
+#define WebKitDisplayContentsEnabledPreferenceKey @"WebKitDisplayContentsEnabled"
 #define WebKitUserTimingEnabledPreferenceKey @"WebKitUserTimingEnabled"
 #define WebKitResourceTimingEnabledPreferenceKey @"WebKitResourceTimingEnabled"

Modified: trunk/Source/WebKit/mac/WebView/WebPreferences.mm (217272 => 217273)


--- trunk/Source/WebKit/mac/WebView/WebPreferences.mm	2017-05-23 07:37:42 UTC (rev 217272)
+++ trunk/Source/WebKit/mac/WebView/WebPreferences.mm	2017-05-23 13:34:46 UTC (rev 217273)
@@ -665,6 +665,7 @@
 #if ENABLE(INTERSECTION_OBSERVER)
         @NO, WebKitIntersectionObserverEnabledPreferenceKey,
 #endif
+        @NO, WebKitDisplayContentsEnabledPreferenceKey,
         @NO, WebKitUserTimingEnabledPreferenceKey,
         @NO, WebKitResourceTimingEnabledPreferenceKey,
         @NO, WebKitCredentialManagementEnabledPreferenceKey,
@@ -3022,6 +3023,16 @@
     [self _setBoolValue:flag forKey:WebKitIntersectionObserverEnabledPreferenceKey];
 }
 
+- (BOOL)displayContentsEnabled
+{
+    return [self _boolValueForKey:WebKitDisplayContentsEnabledPreferenceKey];
+}
+
+- (void)setDisplayContentsEnabled:(BOOL)flag
+{
+    [self _setBoolValue:flag forKey:WebKitDisplayContentsEnabledPreferenceKey];
+}
+
 - (BOOL)userTimingEnabled
 {
     return [self _boolValueForKey:WebKitUserTimingEnabledPreferenceKey];

Modified: trunk/Source/WebKit/mac/WebView/WebPreferencesPrivate.h (217272 => 217273)


--- trunk/Source/WebKit/mac/WebView/WebPreferencesPrivate.h	2017-05-23 07:37:42 UTC (rev 217272)
+++ trunk/Source/WebKit/mac/WebView/WebPreferencesPrivate.h	2017-05-23 13:34:46 UTC (rev 217273)
@@ -552,6 +552,7 @@
 @property (nonatomic) BOOL attachmentElementEnabled;
 @property (nonatomic) BOOL allowsInlineMediaPlaybackAfterFullscreen;
 @property (nonatomic) BOOL intersectionObserverEnabled;
+@property (nonatomic) BOOL displayContentsEnabled;
 @property (nonatomic) BOOL userTimingEnabled;
 @property (nonatomic) BOOL resourceTimingEnabled;
 @property (nonatomic) BOOL linkPreloadEnabled;

Modified: trunk/Source/WebKit/mac/WebView/WebView.mm (217272 => 217273)


--- trunk/Source/WebKit/mac/WebView/WebView.mm	2017-05-23 07:37:42 UTC (rev 217272)
+++ trunk/Source/WebKit/mac/WebView/WebView.mm	2017-05-23 13:34:46 UTC (rev 217273)
@@ -3042,6 +3042,7 @@
 #if ENABLE(INTERSECTION_OBSERVER)
     RuntimeEnabledFeatures::sharedFeatures().setIntersectionObserverEnabled(preferences.intersectionObserverEnabled);
 #endif
+    RuntimeEnabledFeatures::sharedFeatures().setDisplayContentsEnabled(preferences.displayContentsEnabled);
 
 #if ENABLE(SUBTLE_CRYPTO)
     RuntimeEnabledFeatures::sharedFeatures().setSubtleCryptoEnabled([preferences subtleCryptoEnabled]);

Modified: trunk/Source/WebKit2/ChangeLog (217272 => 217273)


--- trunk/Source/WebKit2/ChangeLog	2017-05-23 07:37:42 UTC (rev 217272)
+++ trunk/Source/WebKit2/ChangeLog	2017-05-23 13:34:46 UTC (rev 217273)
@@ -1,3 +1,18 @@
+2017-05-23  Emilio Cobos Álvarez  <eco...@igalia.com>
+
+        Add a RuntimeEnabledFeature for display: contents, defaulted to false.
+        https://bugs.webkit.org/show_bug.cgi?id=171984
+
+        Reviewed by Antti Koivisto.
+
+        * Shared/WebPreferencesDefinitions.h:
+        * UIProcess/API/C/WKPreferences.cpp:
+        (WKPreferencesSetDisplayContentsEnabled):
+        (WKPreferencesGetDisplayContentsEnabled):
+        * UIProcess/API/C/WKPreferencesRefPrivate.h:
+        * WebProcess/WebPage/WebPage.cpp:
+        (WebKit::WebPage::updatePreferences):
+
 2017-05-20  Alex Christensen  <achristen...@webkit.org>
 
         REGRESSION(r215686): O(n^2) algorithm in CachedRawResource::addDataBuffer

Modified: trunk/Source/WebKit2/Shared/WebPreferencesDefinitions.h (217272 => 217273)


--- trunk/Source/WebKit2/Shared/WebPreferencesDefinitions.h	2017-05-23 07:37:42 UTC (rev 217272)
+++ trunk/Source/WebKit2/Shared/WebPreferencesDefinitions.h	2017-05-23 13:34:46 UTC (rev 217273)
@@ -359,6 +359,7 @@
     macro(WebAnimationsEnabled, webAnimationsEnabled, Bool, bool, false, "Web Animations", "Web Animations prototype") \
     macro(WebGL2Enabled, webGL2Enabled, Bool, bool, false, "WebGL 2.0", "WebGL 2 prototype") \
     macro(WebGPUEnabled, webGPUEnabled, Bool, bool, false, "WebGPU", "WebGPU prototype") \
+    macro(DisplayContentsEnabled, displayContentsEnabled, Bool, bool, false, "display: contents", "Enable CSS display: contents support") \
     \
 
 #if PLATFORM(COCOA)

Modified: trunk/Source/WebKit2/UIProcess/API/C/WKPreferences.cpp (217272 => 217273)


--- trunk/Source/WebKit2/UIProcess/API/C/WKPreferences.cpp	2017-05-23 07:37:42 UTC (rev 217272)
+++ trunk/Source/WebKit2/UIProcess/API/C/WKPreferences.cpp	2017-05-23 13:34:46 UTC (rev 217273)
@@ -1621,6 +1621,16 @@
     return toImpl(preferencesRef)->fetchAPIEnabled();
 }
 
+void WKPreferencesSetDisplayContentsEnabled(WKPreferencesRef preferencesRef, bool flag)
+{
+    toImpl(preferencesRef)->setDisplayContentsEnabled(flag);
+}
+
+bool WKPreferencesGetDisplayContentsEnabled(WKPreferencesRef preferencesRef)
+{
+    return toImpl(preferencesRef)->displayContentsEnabled();
+}
+
 void WKPreferencesSetDownloadAttributeEnabled(WKPreferencesRef preferencesRef, bool flag)
 {
     toImpl(preferencesRef)->setDownloadAttributeEnabled(flag);

Modified: trunk/Source/WebKit2/UIProcess/API/C/WKPreferencesRefPrivate.h (217272 => 217273)


--- trunk/Source/WebKit2/UIProcess/API/C/WKPreferencesRefPrivate.h	2017-05-23 07:37:42 UTC (rev 217272)
+++ trunk/Source/WebKit2/UIProcess/API/C/WKPreferencesRefPrivate.h	2017-05-23 13:34:46 UTC (rev 217273)
@@ -454,6 +454,10 @@
 WK_EXPORT bool WKPreferencesGetIntersectionObserverEnabled(WKPreferencesRef);
 
 // Defaults to false
+WK_EXPORT void WKPreferencesSetDisplayContentsEnabled(WKPreferencesRef, bool flag);
+WK_EXPORT bool WKPreferencesGetDisplayContentsEnabled(WKPreferencesRef);
+
+// Defaults to false
 WK_EXPORT void WKPreferencesSetUserTimingEnabled(WKPreferencesRef, bool flag);
 WK_EXPORT bool WKPreferencesGetUserTimingEnabled(WKPreferencesRef);
 

Modified: trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp (217272 => 217273)


--- trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp	2017-05-23 07:37:42 UTC (rev 217272)
+++ trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp	2017-05-23 13:34:46 UTC (rev 217273)
@@ -3354,6 +3354,7 @@
     RuntimeEnabledFeatures::sharedFeatures().setIntersectionObserverEnabled(store.getBoolValueForKey(WebPreferencesKey::intersectionObserverEnabledKey()));
 #endif
 
+    RuntimeEnabledFeatures::sharedFeatures().setDisplayContentsEnabled(store.getBoolValueForKey(WebPreferencesKey::displayContentsEnabledKey()));
     RuntimeEnabledFeatures::sharedFeatures().setUserTimingEnabled(store.getBoolValueForKey(WebPreferencesKey::userTimingEnabledKey()));
     RuntimeEnabledFeatures::sharedFeatures().setResourceTimingEnabled(store.getBoolValueForKey(WebPreferencesKey::resourceTimingEnabledKey()));
     RuntimeEnabledFeatures::sharedFeatures().setLinkPreloadEnabled(store.getBoolValueForKey(WebPreferencesKey::linkPreloadEnabledKey()));

Modified: trunk/Tools/ChangeLog (217272 => 217273)


--- trunk/Tools/ChangeLog	2017-05-23 07:37:42 UTC (rev 217272)
+++ trunk/Tools/ChangeLog	2017-05-23 13:34:46 UTC (rev 217273)
@@ -1,3 +1,15 @@
+2017-05-23  Emilio Cobos Álvarez  <eco...@igalia.com>
+
+        Add a RuntimeEnabledFeature for display: contents, defaulted to false.
+        https://bugs.webkit.org/show_bug.cgi?id=171984
+
+        Reviewed by Antti Koivisto.
+
+        * DumpRenderTree/mac/DumpRenderTree.mm:
+        (enableExperimentalFeatures):
+        * WebKitTestRunner/TestController.cpp:
+        (WTR::TestController::resetPreferencesToConsistentValues):
+
 2017-05-20  Alex Christensen  <achristen...@webkit.org>
 
         REGRESSION(r215686): O(n^2) algorithm in CachedRawResource::addDataBuffer

Modified: trunk/Tools/DumpRenderTree/mac/DumpRenderTree.mm (217272 => 217273)


--- trunk/Tools/DumpRenderTree/mac/DumpRenderTree.mm	2017-05-23 07:37:42 UTC (rev 217272)
+++ trunk/Tools/DumpRenderTree/mac/DumpRenderTree.mm	2017-05-23 13:34:46 UTC (rev 217273)
@@ -838,6 +838,7 @@
 static void enableExperimentalFeatures(WebPreferences* preferences)
 {
     [preferences setCSSGridLayoutEnabled:YES];
+    [preferences setDisplayContentsEnabled:YES];
     // FIXME: SpringTimingFunction
     [preferences setGamepadsEnabled:YES];
     [preferences setLinkPreloadEnabled:YES];

Modified: trunk/Tools/WebKitTestRunner/TestController.cpp (217272 => 217273)


--- trunk/Tools/WebKitTestRunner/TestController.cpp	2017-05-23 07:37:42 UTC (rev 217272)
+++ trunk/Tools/WebKitTestRunner/TestController.cpp	2017-05-23 13:34:46 UTC (rev 217273)
@@ -674,6 +674,7 @@
     WKPreferencesSetArtificialPluginInitializationDelayEnabled(preferences, false);
     WKPreferencesSetTabToLinksEnabled(preferences, false);
     WKPreferencesSetInteractiveFormValidationEnabled(preferences, true);
+    WKPreferencesSetDisplayContentsEnabled(preferences, true);
 
     WKPreferencesSetMockScrollbarsEnabled(preferences, options.useMockScrollbars);
     WKPreferencesSetNeedsSiteSpecificQuirks(preferences, options.needsSiteSpecificQuirks);
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to