Changeset 246938 in webkit


Ignore:
Timestamp:
Jun 28, 2019 2:39:36 PM (5 years ago)
Author:
timothy@apple.com
Message:

Rename effectiveAppearanceIsInactive and useInactiveAppearance to better match UIUserInterfaceLevel.
https://bugs.webkit.org/show_bug.cgi?id=199336
rdar://problem/52348938

Reviewed by Tim Horton.

Source/WebCore:

  • css/StyleColor.h:
  • dom/Document.cpp:

(WebCore::Document::useElevatedUserInterfaceLevel const):
(WebCore::Document::styleColorOptions const):
(WebCore::Document::useInactiveAppearance const): Deleted.

  • dom/Document.h:
  • page/Page.cpp:

(WebCore::Page::effectiveAppearanceDidChange):

  • page/Page.h:

(WebCore::Page::useElevatedUserInterfaceLevel const):
(WebCore::Page::useInactiveAppearance const): Deleted.

  • platform/ios/LocalCurrentTraitCollection.h:

(WebCore::LocalCurrentTraitCollection::usingElevatedUserInterfaceLevel const):
(WebCore::LocalCurrentTraitCollection::usingBaseLevelAppearance const): Deleted.

  • platform/ios/LocalCurrentTraitCollection.mm:

(WebCore::LocalCurrentTraitCollection::LocalCurrentTraitCollection):

  • rendering/RenderThemeIOS.mm:

(WebCore::RenderThemeIOS::systemColor const):

  • testing/InternalSettings.cpp:

(WebCore::InternalSettings::setUseDarkAppearanceInternal):

Source/WebKit:

  • Shared/WebPageCreationParameters.cpp:

(WebKit::WebPageCreationParameters::encode const):
(WebKit::WebPageCreationParameters::decode):

  • Shared/WebPageCreationParameters.h:
  • UIProcess/API/Cocoa/WKWebView.mm:

(-[WKWebView _effectiveUserInterfaceLevelIsElevated]):
(-[WKWebView _effectiveAppearanceIsInactive]): Deleted.

  • UIProcess/API/Cocoa/WKWebViewInternal.h:
  • UIProcess/Cocoa/WebViewImpl.h:
  • UIProcess/Cocoa/WebViewImpl.mm:

(WebKit::WebViewImpl::effectiveUserInterfaceLevelIsElevated):
(WebKit::WebViewImpl::effectiveAppearanceIsInactive): Deleted.

  • UIProcess/PageClient.h:

(WebKit::PageClient::effectiveUserInterfaceLevelIsElevated const):
(WebKit::PageClient::effectiveAppearanceIsInactive const): Deleted.

  • UIProcess/WebPageProxy.cpp:

(WebKit::WebPageProxy::creationParameters):
(WebKit::WebPageProxy::useElevatedUserInterfaceLevel const):
(WebKit::WebPageProxy::effectiveAppearanceDidChange):
(WebKit::WebPageProxy::useInactiveAppearance const): Deleted.

  • UIProcess/WebPageProxy.h:
  • UIProcess/ios/PageClientImplIOS.h:
  • UIProcess/ios/PageClientImplIOS.mm:

(WebKit::PageClientImpl::effectiveUserInterfaceLevelIsElevated const):
(WebKit::PageClientImpl::effectiveAppearanceIsInactive const): Deleted.

  • UIProcess/mac/PageClientImplMac.h:
  • UIProcess/mac/PageClientImplMac.mm:

(WebKit::PageClientImpl::effectiveUserInterfaceLevelIsElevated const):
(WebKit::PageClientImpl::effectiveAppearanceIsInactive const): Deleted.

  • WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:

(WKBundlePageSetUseDarkAppearance):

  • WebProcess/WebPage/WebPage.cpp:

(WebKit::m_shrinkToFitContentTimer):
(WebKit::WebPage::effectiveAppearanceDidChange):

  • WebProcess/WebPage/WebPage.h:
  • WebProcess/WebPage/WebPage.messages.in:

Source/WebKitLegacy/mac:

  • WebView/WebView.mm:

(-[WebView _commonInitializationWithFrameName:groupName:]):
(-[WebView _setUseDarkAppearance:]):
(-[WebView _useElevatedUserInterfaceLevel]):
(-[WebView _setUseElevatedUserInterfaceLevel:]):
(-[WebView _setUseDarkAppearance:useInactiveAppearance:]):
(-[WebView _setUseDarkAppearance:useElevatedUserInterfaceLevel:]):
(-[WebView _effectiveUserInterfaceLevelIsElevated]):
(-[WebView viewDidChangeEffectiveAppearance]):
(-[WebView _useInactiveAppearance]): Deleted.
(-[WebView _setUseInactiveAppearance:]): Deleted.
(-[WebView _effectiveAppearanceIsInactive]): Deleted.

  • WebView/WebViewPrivate.h:
Location:
trunk/Source
Files:
31 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r246934 r246938  
     12019-06-28  Timothy Hatcher  <timothy@apple.com>
     2
     3        Rename effectiveAppearanceIsInactive and useInactiveAppearance to better match UIUserInterfaceLevel.
     4        https://bugs.webkit.org/show_bug.cgi?id=199336
     5        rdar://problem/52348938
     6
     7        Reviewed by Tim Horton.
     8
     9        * css/StyleColor.h:
     10        * dom/Document.cpp:
     11        (WebCore::Document::useElevatedUserInterfaceLevel const):
     12        (WebCore::Document::styleColorOptions const):
     13        (WebCore::Document::useInactiveAppearance const): Deleted.
     14        * dom/Document.h:
     15        * page/Page.cpp:
     16        (WebCore::Page::effectiveAppearanceDidChange):
     17        * page/Page.h:
     18        (WebCore::Page::useElevatedUserInterfaceLevel const):
     19        (WebCore::Page::useInactiveAppearance const): Deleted.
     20        * platform/ios/LocalCurrentTraitCollection.h:
     21        (WebCore::LocalCurrentTraitCollection::usingElevatedUserInterfaceLevel const):
     22        (WebCore::LocalCurrentTraitCollection::usingBaseLevelAppearance const): Deleted.
     23        * platform/ios/LocalCurrentTraitCollection.mm:
     24        (WebCore::LocalCurrentTraitCollection::LocalCurrentTraitCollection):
     25        * rendering/RenderThemeIOS.mm:
     26        (WebCore::RenderThemeIOS::systemColor const):
     27        * testing/InternalSettings.cpp:
     28        (WebCore::InternalSettings::setUseDarkAppearanceInternal):
     29
    1302019-06-28  Simon Fraser  <simon.fraser@apple.com>
    231
  • trunk/Source/WebCore/css/StyleColor.h

    r245072 r246938  
    5656        UseSystemAppearance = 1 << 1,
    5757        UseDarkAppearance = 1 << 2,
    58         UseInactiveAppearance = 1 << 3
     58        UseElevatedUserInterfaceLevel = 1 << 3
    5959    };
    6060
  • trunk/Source/WebCore/dom/Document.cpp

    r246890 r246938  
    69596959}
    69606960
    6961 bool Document::useInactiveAppearance() const
     6961bool Document::useElevatedUserInterfaceLevel() const
    69626962{
    69636963    if (auto* documentPage = page())
    6964         return documentPage->useInactiveAppearance();
     6964        return documentPage->useElevatedUserInterfaceLevel();
    69656965    return false;
    69666966}
     
    69736973    if (useDarkAppearance(style))
    69746974        options.add(StyleColor::Options::UseDarkAppearance);
    6975     if (useInactiveAppearance())
    6976         options.add(StyleColor::Options::UseInactiveAppearance);
     6975    if (useElevatedUserInterfaceLevel())
     6976        options.add(StyleColor::Options::UseElevatedUserInterfaceLevel);
    69776977    return options;
    69786978}
  • trunk/Source/WebCore/dom/Document.h

    r246844 r246938  
    565565
    566566    WEBCORE_EXPORT bool useSystemAppearance() const;
    567     WEBCORE_EXPORT bool useInactiveAppearance() const;
     567    WEBCORE_EXPORT bool useElevatedUserInterfaceLevel() const;
    568568    WEBCORE_EXPORT bool useDarkAppearance(const RenderStyle*) const;
    569569
  • trunk/Source/WebCore/page/Page.cpp

    r246490 r246938  
    27282728}
    27292729
    2730 void Page::effectiveAppearanceDidChange(bool useDarkAppearance, bool useInactiveAppearance)
     2730void Page::effectiveAppearanceDidChange(bool useDarkAppearance, bool useElevatedUserInterfaceLevel)
    27312731{
    27322732#if HAVE(OS_DARK_MODE_SUPPORT)
    2733     if (m_useDarkAppearance == useDarkAppearance && m_useInactiveAppearance == useInactiveAppearance)
     2733    if (m_useDarkAppearance == useDarkAppearance && m_useElevatedUserInterfaceLevel == useElevatedUserInterfaceLevel)
    27342734        return;
    27352735
    27362736    m_useDarkAppearance = useDarkAppearance;
    2737     m_useInactiveAppearance = useInactiveAppearance;
     2737    m_useElevatedUserInterfaceLevel = useElevatedUserInterfaceLevel;
    27382738
    27392739    InspectorInstrumentation::defaultAppearanceDidChange(*this, useDarkAppearance);
     
    27432743    UNUSED_PARAM(useDarkAppearance);
    27442744
    2745     if (m_useInactiveAppearance == useInactiveAppearance)
    2746         return;
    2747 
    2748     m_useInactiveAppearance = useInactiveAppearance;
     2745    if (m_useElevatedUserInterfaceLevel == useElevatedUserInterfaceLevel)
     2746        return;
     2747
     2748    m_useElevatedUserInterfaceLevel = useElevatedUserInterfaceLevel;
    27492749
    27502750    appearanceDidChange();
  • trunk/Source/WebCore/page/Page.h

    r245778 r246938  
    381381   
    382382    WEBCORE_EXPORT bool useDarkAppearance() const;
    383     bool useInactiveAppearance() const { return m_useInactiveAppearance; }
    384     WEBCORE_EXPORT void effectiveAppearanceDidChange(bool useDarkAppearance, bool useInactiveAppearance);
     383    bool useElevatedUserInterfaceLevel() const { return m_useElevatedUserInterfaceLevel; }
     384    WEBCORE_EXPORT void effectiveAppearanceDidChange(bool useDarkAppearance, bool useElevatedUserInterfaceLevel);
    385385    bool defaultUseDarkAppearance() const { return m_useDarkAppearance; }
    386386    void setUseDarkAppearanceOverride(Optional<bool>);
     
    838838   
    839839    bool m_useSystemAppearance { false };
    840     bool m_useInactiveAppearance { false };
     840    bool m_useElevatedUserInterfaceLevel { false };
    841841    bool m_useDarkAppearance { false };
    842842    Optional<bool> m_useDarkAppearanceOverride;
  • trunk/Source/WebCore/platform/ios/LocalCurrentTraitCollection.h

    r246270 r246938  
    4141
    4242public:
    43     WEBCORE_EXPORT LocalCurrentTraitCollection(bool useDarkAppearance, bool useBaseLevelAppearance);
     43    WEBCORE_EXPORT LocalCurrentTraitCollection(bool useDarkAppearance, bool useElevatedUserInterfaceLevel);
    4444    WEBCORE_EXPORT LocalCurrentTraitCollection(UITraitCollection *);
    4545    WEBCORE_EXPORT ~LocalCurrentTraitCollection();
     
    5454    }
    5555
    56     bool usingBaseLevelAppearance() const
     56    bool usingElevatedUserInterfaceLevel() const
    5757    {
    5858#if HAVE(OS_DARK_MODE_SUPPORT)
    59         return m_usingBaseLevelAppearance;
     59        return m_usingElevatedUserInterfaceLevel;
    6060#else
    61         return true;
     61        return false;
    6262#endif
    6363    }
     
    6767    RetainPtr<UITraitCollection> m_savedTraitCollection;
    6868    bool m_usingDarkAppearance { false };
    69     bool m_usingBaseLevelAppearance { true };
     69    bool m_usingElevatedUserInterfaceLevel { false };
    7070#endif
    7171};
  • trunk/Source/WebCore/platform/ios/LocalCurrentTraitCollection.mm

    r246270 r246938  
    3232namespace WebCore {
    3333
    34 LocalCurrentTraitCollection::LocalCurrentTraitCollection(bool useDarkAppearance, bool useBaseLevelAppearance)
     34LocalCurrentTraitCollection::LocalCurrentTraitCollection(bool useDarkAppearance, bool useElevatedUserInterfaceLevel)
    3535{
    3636#if HAVE(OS_DARK_MODE_SUPPORT)
    3737    m_savedTraitCollection = [PAL::getUITraitCollectionClass() _currentTraitCollection];
    3838    m_usingDarkAppearance = useDarkAppearance;
    39     m_usingBaseLevelAppearance = useBaseLevelAppearance;
     39    m_usingElevatedUserInterfaceLevel = useElevatedUserInterfaceLevel;
    4040
    4141    auto userInterfaceStyleTrait = [PAL::getUITraitCollectionClass() traitCollectionWithUserInterfaceStyle:m_usingDarkAppearance ? UIUserInterfaceStyleDark : UIUserInterfaceStyleLight];
    42     auto backgroundLevelTrait = [PAL::getUITraitCollectionClass() traitCollectionWithUserInterfaceLevel:m_usingBaseLevelAppearance ? UIUserInterfaceLevelBase : UIUserInterfaceLevelElevated];
     42    auto backgroundLevelTrait = [PAL::getUITraitCollectionClass() traitCollectionWithUserInterfaceLevel:m_usingElevatedUserInterfaceLevel ? UIUserInterfaceLevelElevated : UIUserInterfaceLevelBase];
    4343    auto newTraitCollection = [PAL::getUITraitCollectionClass() traitCollectionWithTraitsFromCollections:@[ m_savedTraitCollection.get(), userInterfaceStyleTrait, backgroundLevelTrait ]];
    4444
     
    4646#else
    4747    UNUSED_PARAM(useDarkAppearance);
    48     UNUSED_PARAM(useBaseLevelAppearance);
     48    UNUSED_PARAM(useElevatedUserInterfaceLevel);
    4949#endif
    5050}
     
    5555    m_savedTraitCollection = [PAL::getUITraitCollectionClass() _currentTraitCollection];
    5656    m_usingDarkAppearance = traitCollection.userInterfaceStyle == UIUserInterfaceStyleDark;
    57     m_usingBaseLevelAppearance = traitCollection.userInterfaceLevel == UIUserInterfaceLevelBase;
     57    m_usingElevatedUserInterfaceLevel = traitCollection.userInterfaceLevel == UIUserInterfaceLevelElevated;
    5858
    5959    [PAL::getUITraitCollectionClass() _setCurrentTraitCollection:traitCollection];
  • trunk/Source/WebCore/rendering/RenderThemeIOS.mm

    r246270 r246938  
    14451445    return cache.systemStyleColors.ensure(cssValueID, [this, cssValueID, options] () -> Color {
    14461446        const bool useDarkAppearance = options.contains(StyleColor::Options::UseDarkAppearance);
    1447         const bool useInactiveAppearance = options.contains(StyleColor::Options::UseInactiveAppearance);
    1448         LocalCurrentTraitCollection localTraitCollection(useDarkAppearance, useInactiveAppearance);
     1447        const bool useElevatedUserInterfaceLevel = options.contains(StyleColor::Options::UseElevatedUserInterfaceLevel);
     1448        LocalCurrentTraitCollection localTraitCollection(useDarkAppearance, useElevatedUserInterfaceLevel);
    14491449
    14501450        auto cssColorToSelector = [cssValueID] () -> SEL {
  • trunk/Source/WebCore/testing/InternalSettings.cpp

    r245072 r246938  
    549549#endif
    550550    ASSERT(m_page);
    551     m_page->effectiveAppearanceDidChange(useDarkAppearance, m_page->useInactiveAppearance());
     551    m_page->effectiveAppearanceDidChange(useDarkAppearance, m_page->useElevatedUserInterfaceLevel());
    552552}
    553553
  • trunk/Source/WebKit/ChangeLog

    r246933 r246938  
     12019-06-28  Timothy Hatcher  <timothy@apple.com>
     2
     3        Rename effectiveAppearanceIsInactive and useInactiveAppearance to better match UIUserInterfaceLevel.
     4        https://bugs.webkit.org/show_bug.cgi?id=199336
     5        rdar://problem/52348938
     6
     7        Reviewed by Tim Horton.
     8
     9        * Shared/WebPageCreationParameters.cpp:
     10        (WebKit::WebPageCreationParameters::encode const):
     11        (WebKit::WebPageCreationParameters::decode):
     12        * Shared/WebPageCreationParameters.h:
     13        * UIProcess/API/Cocoa/WKWebView.mm:
     14        (-[WKWebView _effectiveUserInterfaceLevelIsElevated]):
     15        (-[WKWebView _effectiveAppearanceIsInactive]): Deleted.
     16        * UIProcess/API/Cocoa/WKWebViewInternal.h:
     17        * UIProcess/Cocoa/WebViewImpl.h:
     18        * UIProcess/Cocoa/WebViewImpl.mm:
     19        (WebKit::WebViewImpl::effectiveUserInterfaceLevelIsElevated):
     20        (WebKit::WebViewImpl::effectiveAppearanceIsInactive): Deleted.
     21        * UIProcess/PageClient.h:
     22        (WebKit::PageClient::effectiveUserInterfaceLevelIsElevated const):
     23        (WebKit::PageClient::effectiveAppearanceIsInactive const): Deleted.
     24        * UIProcess/WebPageProxy.cpp:
     25        (WebKit::WebPageProxy::creationParameters):
     26        (WebKit::WebPageProxy::useElevatedUserInterfaceLevel const):
     27        (WebKit::WebPageProxy::effectiveAppearanceDidChange):
     28        (WebKit::WebPageProxy::useInactiveAppearance const): Deleted.
     29        * UIProcess/WebPageProxy.h:
     30        * UIProcess/ios/PageClientImplIOS.h:
     31        * UIProcess/ios/PageClientImplIOS.mm:
     32        (WebKit::PageClientImpl::effectiveUserInterfaceLevelIsElevated const):
     33        (WebKit::PageClientImpl::effectiveAppearanceIsInactive const): Deleted.
     34        * UIProcess/mac/PageClientImplMac.h:
     35        * UIProcess/mac/PageClientImplMac.mm:
     36        (WebKit::PageClientImpl::effectiveUserInterfaceLevelIsElevated const):
     37        (WebKit::PageClientImpl::effectiveAppearanceIsInactive const): Deleted.
     38        * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
     39        (WKBundlePageSetUseDarkAppearance):
     40        * WebProcess/WebPage/WebPage.cpp:
     41        (WebKit::m_shrinkToFitContentTimer):
     42        (WebKit::WebPage::effectiveAppearanceDidChange):
     43        * WebProcess/WebPage/WebPage.h:
     44        * WebProcess/WebPage/WebPage.messages.in:
     45
    1462019-06-28  Jer Noble  <jer.noble@apple.com>
    247
  • trunk/Source/WebKit/Shared/WebPageCreationParameters.cpp

    r246347 r246938  
    7979    encoder << isProcessSwap;
    8080    encoder << useDarkAppearance;
    81     encoder << useInactiveAppearance;
     81    encoder << useElevatedUserInterfaceLevel;
    8282
    8383#if PLATFORM(MAC)
     
    256256    if (!decoder.decode(parameters.useDarkAppearance))
    257257        return WTF::nullopt;
    258     if (!decoder.decode(parameters.useInactiveAppearance))
     258    if (!decoder.decode(parameters.useElevatedUserInterfaceLevel))
    259259        return WTF::nullopt;
    260260
  • trunk/Source/WebKit/Shared/WebPageCreationParameters.h

    r246347 r246938  
    139139
    140140    bool useDarkAppearance { false };
    141     bool useInactiveAppearance { false };
     141    bool useElevatedUserInterfaceLevel { false };
    142142
    143143#if PLATFORM(MAC)
  • trunk/Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm

    r246933 r246938  
    481481}
    482482
    483 - (BOOL)_effectiveAppearanceIsInactive
     483- (BOOL)_effectiveUserInterfaceLevelIsElevated
    484484{
    485485#if HAVE(OS_DARK_MODE_SUPPORT) && !PLATFORM(WATCHOS)
    486     return self.traitCollection.userInterfaceLevel != UIUserInterfaceLevelElevated;
     486    return self.traitCollection.userInterfaceLevel == UIUserInterfaceLevelElevated;
    487487#else
    488488    return NO;
  • trunk/Source/WebKit/UIProcess/API/Cocoa/WKWebViewInternal.h

    r246892 r246938  
    172172
    173173- (BOOL)_effectiveAppearanceIsDark;
    174 - (BOOL)_effectiveAppearanceIsInactive;
     174- (BOOL)_effectiveUserInterfaceLevelIsElevated;
    175175#endif // PLATFORM(IOS_FAMILY)
    176176
  • trunk/Source/WebKit/UIProcess/Cocoa/WebViewImpl.h

    r246224 r246938  
    600600    void effectiveAppearanceDidChange();
    601601    bool effectiveAppearanceIsDark();
    602     bool effectiveAppearanceIsInactive();
     602    bool effectiveUserInterfaceLevelIsElevated();
    603603
    604604    void takeFocus(WebCore::FocusDirection);
  • trunk/Source/WebKit/UIProcess/Cocoa/WebViewImpl.mm

    r246224 r246938  
    53155315}
    53165316
    5317 bool WebViewImpl::effectiveAppearanceIsInactive()
    5318 {
    5319     // FIXME: Use the window isKeyWindow state or view first responder status?
     5317bool WebViewImpl::effectiveUserInterfaceLevelIsElevated()
     5318{
    53205319    return false;
    53215320}
  • trunk/Source/WebKit/UIProcess/PageClient.h

    r246347 r246938  
    328328
    329329    virtual bool effectiveAppearanceIsDark() const { return false; }
    330     virtual bool effectiveAppearanceIsInactive() const { return false; }
     330    virtual bool effectiveUserInterfaceLevelIsElevated() const { return false; }
    331331
    332332    virtual void enterAcceleratedCompositingMode(const LayerTreeContext&) = 0;
  • trunk/Source/WebKit/UIProcess/WebPageProxy.cpp

    r246856 r246938  
    71777177    parameters.controlledByAutomation = m_controlledByAutomation;
    71787178    parameters.useDarkAppearance = useDarkAppearance();
    7179     parameters.useInactiveAppearance = useInactiveAppearance();
     7179    parameters.useElevatedUserInterfaceLevel = useElevatedUserInterfaceLevel();
    71807180#if PLATFORM(MAC)
    71817181    parameters.colorSpace = pageClient().colorSpace();
     
    87058705}
    87068706
    8707 bool WebPageProxy::useInactiveAppearance() const
    8708 {
    8709     return pageClient().effectiveAppearanceIsInactive();
     8707bool WebPageProxy::useElevatedUserInterfaceLevel() const
     8708{
     8709    return pageClient().effectiveUserInterfaceLevelIsElevated();
    87108710}
    87118711
     
    87158715        return;
    87168716
    8717     m_process->send(Messages::WebPage::EffectiveAppearanceDidChange(useDarkAppearance(), useInactiveAppearance()), m_pageID);
     8717    m_process->send(Messages::WebPage::EffectiveAppearanceDidChange(useDarkAppearance(), useElevatedUserInterfaceLevel()), m_pageID);
    87188718}
    87198719
  • trunk/Source/WebKit/UIProcess/WebPageProxy.h

    r246924 r246938  
    955955    void effectiveAppearanceDidChange();
    956956    bool useDarkAppearance() const;
    957     bool useInactiveAppearance() const;
     957    bool useElevatedUserInterfaceLevel() const;
    958958
    959959#if PLATFORM(COCOA)
  • trunk/Source/WebKit/UIProcess/ios/PageClientImplIOS.h

    r246347 r246938  
    143143
    144144    bool effectiveAppearanceIsDark() const override;
    145     bool effectiveAppearanceIsInactive() const override;
     145    bool effectiveUserInterfaceLevelIsElevated() const override;
    146146
    147147    void couldNotRestorePageState() override;
  • trunk/Source/WebKit/UIProcess/ios/PageClientImplIOS.mm

    r246347 r246938  
    482482}
    483483
    484 bool PageClientImpl::effectiveAppearanceIsInactive() const
    485 {
    486     return [m_webView _effectiveAppearanceIsInactive];
     484bool PageClientImpl::effectiveUserInterfaceLevelIsElevated() const
     485{
     486    return [m_webView _effectiveUserInterfaceLevelIsElevated];
    487487}
    488488
  • trunk/Source/WebKit/UIProcess/mac/PageClientImplMac.h

    r245072 r246938  
    242242    WebCore::UserInterfaceLayoutDirection userInterfaceLayoutDirection() override;
    243243    bool effectiveAppearanceIsDark() const override;
    244     bool effectiveAppearanceIsInactive() const override;
     244    bool effectiveUserInterfaceLevelIsElevated() const override;
    245245
    246246#if ENABLE(DRAG_SUPPORT)
  • trunk/Source/WebKit/UIProcess/mac/PageClientImplMac.mm

    r245072 r246938  
    945945}
    946946
    947 bool PageClientImpl::effectiveAppearanceIsInactive() const
    948 {
    949     return m_impl->effectiveAppearanceIsInactive();
     947bool PageClientImpl::effectiveUserInterfaceLevelIsElevated() const
     948{
     949    return m_impl->effectiveUserInterfaceLevelIsElevated();
    950950}
    951951
  • trunk/Source/WebKit/WebProcess/InjectedBundle/API/c/WKBundlePage.cpp

    r245072 r246938  
    594594    WebKit::WebPage* webPage = WebKit::toImpl(pageRef);
    595595    if (WebCore::Page* page = webPage ? webPage->corePage() : nullptr)
    596         page->effectiveAppearanceDidChange(useDarkAppearance, page->useInactiveAppearance());
     596        page->effectiveAppearanceDidChange(useDarkAppearance, page->useElevatedUserInterfaceLevel());
    597597}
    598598
  • trunk/Source/WebKit/WebProcess/WebPage/WebPage.cpp

    r246872 r246938  
    565565    setPaginationLineGridEnabled(parameters.paginationLineGridEnabled);
    566566
    567     effectiveAppearanceDidChange(parameters.useDarkAppearance, parameters.useInactiveAppearance);
     567    effectiveAppearanceDidChange(parameters.useDarkAppearance, parameters.useElevatedUserInterfaceLevel);
    568568
    569569    if (parameters.isEditable)
     
    46574657
    46584658#if !PLATFORM(GTK)
    4659 void WebPage::effectiveAppearanceDidChange(bool useDarkAppearance, bool useInactiveAppearance)
    4660 {
    4661     corePage()->effectiveAppearanceDidChange(useDarkAppearance, useInactiveAppearance);
     4659void WebPage::effectiveAppearanceDidChange(bool useDarkAppearance, bool useElevatedUserInterfaceLevel)
     4660{
     4661    corePage()->effectiveAppearanceDidChange(useDarkAppearance, useElevatedUserInterfaceLevel);
    46624662}
    46634663#endif
  • trunk/Source/WebKit/WebProcess/WebPage/WebPage.h

    r246872 r246938  
    554554#endif
    555555
    556     void effectiveAppearanceDidChange(bool useDarkAppearance, bool useInactiveAppearance);
     556    void effectiveAppearanceDidChange(bool useDarkAppearance, bool useElevatedUserInterfaceLevel);
    557557
    558558    bool windowIsFocused() const;
  • trunk/Source/WebKit/WebProcess/WebPage/WebPage.messages.in

    r246872 r246938  
    490490#endif
    491491
    492     EffectiveAppearanceDidChange(bool useDarkAppearance, bool useInactiveAppearance);
     492    EffectiveAppearanceDidChange(bool useDarkAppearance, bool useElevatedUserInterfaceLevel);
    493493
    494494#if PLATFORM(COCOA)
  • trunk/Source/WebKitLegacy/mac/ChangeLog

    r246925 r246938  
     12019-06-28  Timothy Hatcher  <timothy@apple.com>
     2
     3        Rename effectiveAppearanceIsInactive and useInactiveAppearance to better match UIUserInterfaceLevel.
     4        https://bugs.webkit.org/show_bug.cgi?id=199336
     5        rdar://problem/52348938
     6
     7        Reviewed by Tim Horton.
     8
     9        * WebView/WebView.mm:
     10        (-[WebView _commonInitializationWithFrameName:groupName:]):
     11        (-[WebView _setUseDarkAppearance:]):
     12        (-[WebView _useElevatedUserInterfaceLevel]):
     13        (-[WebView _setUseElevatedUserInterfaceLevel:]):
     14        (-[WebView _setUseDarkAppearance:useInactiveAppearance:]):
     15        (-[WebView _setUseDarkAppearance:useElevatedUserInterfaceLevel:]):
     16        (-[WebView _effectiveUserInterfaceLevelIsElevated]):
     17        (-[WebView viewDidChangeEffectiveAppearance]):
     18        (-[WebView _useInactiveAppearance]): Deleted.
     19        (-[WebView _setUseInactiveAppearance:]): Deleted.
     20        (-[WebView _effectiveAppearanceIsInactive]): Deleted.
     21        * WebView/WebViewPrivate.h:
     22
    1232019-06-28  Konstantin Tokarev  <annulen@yandex.ru>
    224
  • trunk/Source/WebKitLegacy/mac/WebView/WebView.mm

    r246925 r246938  
    15861586
    15871587#if HAVE(OS_DARK_MODE_SUPPORT) && PLATFORM(MAC)
    1588     _private->page->effectiveAppearanceDidChange(self._effectiveAppearanceIsDark, self._effectiveAppearanceIsInactive);
     1588    _private->page->effectiveAppearanceDidChange(self._effectiveAppearanceIsDark, self._effectiveUserInterfaceLevelIsElevated);
    15891589#endif
    15901590
     
    24972497    if (!_private || !_private->page)
    24982498        return;
    2499     [self _setUseDarkAppearance:useDarkAppearance useInactiveAppearance:_private->page->useInactiveAppearance()];
    2500 }
    2501 
    2502 - (BOOL)_useInactiveAppearance
     2499    [self _setUseDarkAppearance:useDarkAppearance useElevatedUserInterfaceLevel:_private->page->useElevatedUserInterfaceLevel()];
     2500}
     2501
     2502- (BOOL)_useElevatedUserInterfaceLevel
    25032503{
    25042504    if (!_private || !_private->page)
    25052505        return NO;
    2506     return _private->page->useInactiveAppearance();
    2507 }
    2508 
    2509 - (void)_setUseInactiveAppearance:(BOOL)useInactiveAppearance
     2506    return _private->page->useElevatedUserInterfaceLevel();
     2507}
     2508
     2509- (void)_setUseElevatedUserInterfaceLevel:(BOOL)useElevatedUserInterfaceLevel
    25102510{
    25112511    if (!_private || !_private->page)
    25122512        return;
    2513     [self _setUseDarkAppearance:_private->page->useDarkAppearance() useInactiveAppearance:useInactiveAppearance];
     2513    [self _setUseDarkAppearance:_private->page->useDarkAppearance() useElevatedUserInterfaceLevel:useElevatedUserInterfaceLevel];
    25142514}
    25152515
    25162516- (void)_setUseDarkAppearance:(BOOL)useDarkAppearance useInactiveAppearance:(BOOL)useInactiveAppearance
    25172517{
     2518    // FIXME: Remove once UIWebView has moved off this old method.
     2519    [self _setUseDarkAppearance:useDarkAppearance useElevatedUserInterfaceLevel:!useInactiveAppearance];
     2520}
     2521
     2522- (void)_setUseDarkAppearance:(BOOL)useDarkAppearance useElevatedUserInterfaceLevel:(BOOL)useElevatedUserInterfaceLevel
     2523{
    25182524    if (!_private || !_private->page)
    25192525        return;
    2520     _private->page->effectiveAppearanceDidChange(useDarkAppearance, useInactiveAppearance);
     2526    _private->page->effectiveAppearanceDidChange(useDarkAppearance, useElevatedUserInterfaceLevel);
    25212527}
    25222528
     
    51875193}
    51885194
    5189 - (bool)_effectiveAppearanceIsInactive
    5190 {
    5191     // FIXME: Use the window isKeyWindow state or view first responder status?
     5195- (bool)_effectiveUserInterfaceLevelIsElevated
     5196{
    51925197    return false;
    51935198}
     
    52165221        return;
    52175222
    5218     _private->page->effectiveAppearanceDidChange(self._effectiveAppearanceIsDark, self._effectiveAppearanceIsInactive);
     5223    _private->page->effectiveAppearanceDidChange(self._effectiveAppearanceIsDark, self._effectiveUserInterfaceLevelIsElevated);
    52195224}
    52205225#endif
  • trunk/Source/WebKitLegacy/mac/WebView/WebViewPrivate.h

    r246285 r246938  
    325325
    326326@property (nonatomic, assign, setter=_setUseDarkAppearance:) BOOL _useDarkAppearance;
    327 @property (nonatomic, assign, setter=_setUseInactiveAppearance:) BOOL _useInactiveAppearance;
     327@property (nonatomic, assign, setter=_setUseElevatedUserInterfaceLevel:) BOOL _useElevatedUserInterfaceLevel;
    328328
    329329- (void)_setUseDarkAppearance:(BOOL)useDarkAppearance useInactiveAppearance:(BOOL)useInactiveAppearance;
     330- (void)_setUseDarkAppearance:(BOOL)useDarkAppearance useElevatedUserInterfaceLevel:(BOOL)useElevatedUserInterfaceLevel;
    330331
    331332- (WebInspector *)inspector;
Note: See TracChangeset for help on using the changeset viewer.