Changeset 217273 in webkit


Ignore:
Timestamp:
May 23, 2017 6:34:46 AM (7 years ago)
Author:
commit-queue@webkit.org
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 <ecobos@igalia.com> on 2017-05-22
Reviewed by Antti Koivisto.

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

Source/WebCore:

Patch by Emilio Cobos Álvarez <ecobos@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 <ecobos@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 <ecobos@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 <ecobos@igalia.com> on 2017-05-23
Reviewed by Antti Koivisto.

  • DumpRenderTree/mac/DumpRenderTree.mm:

(enableExperimentalFeatures):

  • WebKitTestRunner/TestController.cpp:

(WTR::TestController::resetPreferencesToConsistentValues):

Location:
trunk
Files:
19 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/imported/w3c/ChangeLog

    r217225 r217273  
     12017-05-22 Emilio Cobos Álvarez  <ecobos@igalia.com>
     2
     3        Add a RuntimeEnabledFeature for display: contents, defaulted to false.
     4        https://bugs.webkit.org/show_bug.cgi?id=171984
     5
     6        Reviewed by Antti Koivisto.
     7
     8        * web-platform-tests/innerText/getter-expected.txt:
     9
    1102017-05-22  youenn fablet  <youenn@apple.com>
    211
  • trunk/LayoutTests/imported/w3c/web-platform-tests/cssom/getComputedStyle-pseudo-expected.txt

    r217125 r217273  
    11
    22PASS Resolution of width is correct for ::before and ::after pseudo-elements
    3 PASS Resolution of width is correct for ::before and ::after pseudo-elements of display: contents elements
     3FAIL Resolution of width is correct for ::before and ::after pseudo-elements of display: contents elements assert_equals: expected "50px" but got "auto"
    44
  • trunk/LayoutTests/imported/w3c/web-platform-tests/innerText/getter-expected.txt

    r216981 r217273  
    5252PASS child of display:none child of svg ("<div style='display:none'><div id='target'>abc")
    5353PASS display:contents container ("<div style='display:contents'>abc")
    54 PASS display:contents container ("<div><div style='display:contents'>abc")
     54FAIL display:contents container ("<div><div style='display:contents'>abc") assert_equals: expected "abc" but got "abc\n"
    5555PASS display:contents rendered ("<div>123<span style='display:contents'>abc")
    56 PASS display:contents not processed via textContent ("<div style='display:contents'>   ")
     56FAIL display:contents not processed via textContent ("<div style='display:contents'>   ") assert_equals: expected "" but got "   "
    5757PASS display:contents not processed via textContent ("<div><div style='display:contents'>   ")
    5858PASS visibility:hidden container ("<div style='visibility:hidden'>abc")
  • trunk/Source/WebCore/ChangeLog

    r217272 r217273  
     12017-05-22 Emilio Cobos Álvarez  <ecobos@igalia.com>
     2
     3        Add a RuntimeEnabledFeature for display: contents, defaulted to false.
     4        https://bugs.webkit.org/show_bug.cgi?id=171984
     5
     6        Reviewed by Antti Koivisto.
     7
     8        The "defaulted to false" is not only because there are spec issues,
     9        but because I ran the WPT suite, and there was a fair amount of
     10        crashes and messed render trees.
     11
     12        Tests: imported/w3c/web-platform-tests/innerText/getter.html
     13
     14        * css/StyleResolver.cpp:
     15        (WebCore::StyleResolver::adjustRenderStyle):
     16        * page/RuntimeEnabledFeatures.h:
     17        (WebCore::RuntimeEnabledFeatures::setDisplayContentsEnabled):
     18        (WebCore::RuntimeEnabledFeatures::displayContentsEnabled):
     19
    1202017-05-22  Myles C. Maxfield  <mmaxfield@apple.com>
    221
  • trunk/Source/WebCore/css/StyleResolver.cpp

    r216981 r217273  
    106106#include "RenderView.h"
    107107#include "RuleSet.h"
     108#include "RuntimeEnabledFeatures.h"
    108109#include "SVGDocument.h"
    109110#include "SVGDocumentExtensions.h"
     
    796797    if (style.display() == CONTENTS) {
    797798        // FIXME: Enable for all elements.
    798         bool elementSupportsDisplayContents = is<HTMLSlotElement>(element);
     799        bool elementSupportsDisplayContents = is<HTMLSlotElement>(element) || RuntimeEnabledFeatures::sharedFeatures().displayContentsEnabled();
    799800        if (!elementSupportsDisplayContents)
    800801            style.setDisplay(INLINE);
  • trunk/Source/WebCore/page/RuntimeEnabledFeatures.h

    r217071 r217273  
    4444    WTF_MAKE_NONCOPYABLE(RuntimeEnabledFeatures);
    4545public:
     46    void setDisplayContentsEnabled(bool isEnabled) { m_isDisplayContentsEnabled = isEnabled; }
     47    bool displayContentsEnabled() const { return m_isDisplayContentsEnabled; }
     48
    4649    void setLinkPreloadEnabled(bool isEnabled) { m_isLinkPreloadEnabled = isEnabled; }
    4750    bool linkPreloadEnabled() const { return m_isLinkPreloadEnabled; }
     
    214217    bool m_isCredentialManagementEnabled { false };
    215218
     219    bool m_isDisplayContentsEnabled { false };
    216220    bool m_isShadowDOMEnabled { true };
    217221    bool m_areCustomElementsEnabled { true };
  • trunk/Source/WebKit/mac/ChangeLog

    r217251 r217273  
     12017-05-23  Emilio Cobos Álvarez  <ecobos@igalia.com>
     2
     3        Add a RuntimeEnabledFeature for display: contents, defaulted to false.
     4        https://bugs.webkit.org/show_bug.cgi?id=171984
     5
     6        Reviewed by Antti Koivisto.
     7
     8        * WebView/WebPreferenceKeysPrivate.h:
     9        * WebView/WebPreferences.mm:
     10        (+[WebPreferences initialize]):
     11        (-[WebPreferences displayContentsEnabled]):
     12        (-[WebPreferences setDisplayContentsEnabled:]):
     13        * WebView/WebPreferencesPrivate.h:
     14        * WebView/WebView.mm:
     15        (-[WebView _preferencesChanged:]):
     16
    1172017-05-22  Youenn Fablet  <youenn@apple.com>
    218
  • trunk/Source/WebKit/mac/WebView/WebPreferenceKeysPrivate.h

    r217251 r217273  
    234234#define WebKitAttachmentElementEnabledPreferenceKey @"WebKitAttachmentElementEnabled"
    235235#define WebKitIntersectionObserverEnabledPreferenceKey @"WebKitIntersectionObserverEnabled"
     236#define WebKitDisplayContentsEnabledPreferenceKey @"WebKitDisplayContentsEnabled"
    236237#define WebKitUserTimingEnabledPreferenceKey @"WebKitUserTimingEnabled"
    237238#define WebKitResourceTimingEnabledPreferenceKey @"WebKitResourceTimingEnabled"
  • trunk/Source/WebKit/mac/WebView/WebPreferences.mm

    r217251 r217273  
    666666        @NO, WebKitIntersectionObserverEnabledPreferenceKey,
    667667#endif
     668        @NO, WebKitDisplayContentsEnabledPreferenceKey,
    668669        @NO, WebKitUserTimingEnabledPreferenceKey,
    669670        @NO, WebKitResourceTimingEnabledPreferenceKey,
     
    30233024}
    30243025
     3026- (BOOL)displayContentsEnabled
     3027{
     3028    return [self _boolValueForKey:WebKitDisplayContentsEnabledPreferenceKey];
     3029}
     3030
     3031- (void)setDisplayContentsEnabled:(BOOL)flag
     3032{
     3033    [self _setBoolValue:flag forKey:WebKitDisplayContentsEnabledPreferenceKey];
     3034}
     3035
    30253036- (BOOL)userTimingEnabled
    30263037{
  • trunk/Source/WebKit/mac/WebView/WebPreferencesPrivate.h

    r217251 r217273  
    553553@property (nonatomic) BOOL allowsInlineMediaPlaybackAfterFullscreen;
    554554@property (nonatomic) BOOL intersectionObserverEnabled;
     555@property (nonatomic) BOOL displayContentsEnabled;
    555556@property (nonatomic) BOOL userTimingEnabled;
    556557@property (nonatomic) BOOL resourceTimingEnabled;
  • trunk/Source/WebKit/mac/WebView/WebView.mm

    r217251 r217273  
    30433043    RuntimeEnabledFeatures::sharedFeatures().setIntersectionObserverEnabled(preferences.intersectionObserverEnabled);
    30443044#endif
     3045    RuntimeEnabledFeatures::sharedFeatures().setDisplayContentsEnabled(preferences.displayContentsEnabled);
    30453046
    30463047#if ENABLE(SUBTLE_CRYPTO)
  • trunk/Source/WebKit2/ChangeLog

    r217260 r217273  
     12017-05-23  Emilio Cobos Álvarez  <ecobos@igalia.com>
     2
     3        Add a RuntimeEnabledFeature for display: contents, defaulted to false.
     4        https://bugs.webkit.org/show_bug.cgi?id=171984
     5
     6        Reviewed by Antti Koivisto.
     7
     8        * Shared/WebPreferencesDefinitions.h:
     9        * UIProcess/API/C/WKPreferences.cpp:
     10        (WKPreferencesSetDisplayContentsEnabled):
     11        (WKPreferencesGetDisplayContentsEnabled):
     12        * UIProcess/API/C/WKPreferencesRefPrivate.h:
     13        * WebProcess/WebPage/WebPage.cpp:
     14        (WebKit::WebPage::updatePreferences):
     15
    1162017-05-20  Alex Christensen  <achristensen@webkit.org>
    217
  • trunk/Source/WebKit2/Shared/WebPreferencesDefinitions.h

    r217251 r217273  
    360360    macro(WebGL2Enabled, webGL2Enabled, Bool, bool, false, "WebGL 2.0", "WebGL 2 prototype") \
    361361    macro(WebGPUEnabled, webGPUEnabled, Bool, bool, false, "WebGPU", "WebGPU prototype") \
     362    macro(DisplayContentsEnabled, displayContentsEnabled, Bool, bool, false, "display: contents", "Enable CSS display: contents support") \
    362363    \
    363364
  • trunk/Source/WebKit2/UIProcess/API/C/WKPreferences.cpp

    r217251 r217273  
    16221622}
    16231623
     1624void WKPreferencesSetDisplayContentsEnabled(WKPreferencesRef preferencesRef, bool flag)
     1625{
     1626    toImpl(preferencesRef)->setDisplayContentsEnabled(flag);
     1627}
     1628
     1629bool WKPreferencesGetDisplayContentsEnabled(WKPreferencesRef preferencesRef)
     1630{
     1631    return toImpl(preferencesRef)->displayContentsEnabled();
     1632}
     1633
    16241634void WKPreferencesSetDownloadAttributeEnabled(WKPreferencesRef preferencesRef, bool flag)
    16251635{
  • trunk/Source/WebKit2/UIProcess/API/C/WKPreferencesRefPrivate.h

    r217251 r217273  
    455455
    456456// Defaults to false
     457WK_EXPORT void WKPreferencesSetDisplayContentsEnabled(WKPreferencesRef, bool flag);
     458WK_EXPORT bool WKPreferencesGetDisplayContentsEnabled(WKPreferencesRef);
     459
     460// Defaults to false
    457461WK_EXPORT void WKPreferencesSetUserTimingEnabled(WKPreferencesRef, bool flag);
    458462WK_EXPORT bool WKPreferencesGetUserTimingEnabled(WKPreferencesRef);
  • trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp

    r217251 r217273  
    33553355#endif
    33563356
     3357    RuntimeEnabledFeatures::sharedFeatures().setDisplayContentsEnabled(store.getBoolValueForKey(WebPreferencesKey::displayContentsEnabledKey()));
    33573358    RuntimeEnabledFeatures::sharedFeatures().setUserTimingEnabled(store.getBoolValueForKey(WebPreferencesKey::userTimingEnabledKey()));
    33583359    RuntimeEnabledFeatures::sharedFeatures().setResourceTimingEnabled(store.getBoolValueForKey(WebPreferencesKey::resourceTimingEnabledKey()));
  • trunk/Tools/ChangeLog

    r217260 r217273  
     12017-05-23  Emilio Cobos Álvarez  <ecobos@igalia.com>
     2
     3        Add a RuntimeEnabledFeature for display: contents, defaulted to false.
     4        https://bugs.webkit.org/show_bug.cgi?id=171984
     5
     6        Reviewed by Antti Koivisto.
     7
     8        * DumpRenderTree/mac/DumpRenderTree.mm:
     9        (enableExperimentalFeatures):
     10        * WebKitTestRunner/TestController.cpp:
     11        (WTR::TestController::resetPreferencesToConsistentValues):
     12
    1132017-05-20  Alex Christensen  <achristensen@webkit.org>
    214
  • trunk/Tools/DumpRenderTree/mac/DumpRenderTree.mm

    r216981 r217273  
    839839{
    840840    [preferences setCSSGridLayoutEnabled:YES];
     841    [preferences setDisplayContentsEnabled:YES];
    841842    // FIXME: SpringTimingFunction
    842843    [preferences setGamepadsEnabled:YES];
  • trunk/Tools/WebKitTestRunner/TestController.cpp

    r217068 r217273  
    675675    WKPreferencesSetTabToLinksEnabled(preferences, false);
    676676    WKPreferencesSetInteractiveFormValidationEnabled(preferences, true);
     677    WKPreferencesSetDisplayContentsEnabled(preferences, true);
    677678
    678679    WKPreferencesSetMockScrollbarsEnabled(preferences, options.useMockScrollbars);
Note: See TracChangeset for help on using the changeset viewer.