Changeset 232001 in webkit


Ignore:
Timestamp:
May 19, 2018 4:07:38 PM (6 years ago)
Author:
eric.carlson@apple.com
Message:

Improve NowPlaying "title"
https://bugs.webkit.org/show_bug.cgi?id=185680
<rdar://problem/40296700>

Reviewed by Dean Jackson.

  • html/HTMLMediaElement.cpp:

(WebCore::HTMLMediaElement::mediaSessionTitle const): Use decodeHostName and
topPrivatelyControlledDomain when possible to make the host name more readable.

  • platform/PublicSuffix.h:
  • platform/mac/PublicSuffixMac.mm:

(WebCore::decodeHostName): Expose topPrivatelyControlledDomain method to .cpp functions.

Location:
trunk/Source/WebCore
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r231997 r232001  
     12018-05-19  Eric Carlson  <eric.carlson@apple.com>
     2
     3        Improve NowPlaying "title"
     4        https://bugs.webkit.org/show_bug.cgi?id=185680
     5        <rdar://problem/40296700>
     6
     7        Reviewed by Dean Jackson.
     8
     9        * html/HTMLMediaElement.cpp:
     10        (WebCore::HTMLMediaElement::mediaSessionTitle const): Use decodeHostName and
     11        topPrivatelyControlledDomain when possible to make the host name more readable.
     12
     13        * platform/PublicSuffix.h:
     14        * platform/mac/PublicSuffixMac.mm:
     15        (WebCore::decodeHostName): Expose topPrivatelyControlledDomain method to .cpp functions.
     16
    1172018-05-19  Commit Queue  <commit-queue@webkit.org>
    218
  • trunk/Source/WebCore/html/HTMLMediaElement.cpp

    r231997 r232001  
    7373#include "PlatformMediaSessionManager.h"
    7474#include "ProgressTracker.h"
     75#include "PublicSuffix.h"
    7576#include "RenderLayerCompositor.h"
    7677#include "RenderTheme.h"
     
    74537454        return emptyString();
    74547455
    7455     if (hasAttributeWithoutSynchronization(titleAttr)) {
    7456         auto title = attributeWithoutSynchronization(titleAttr);
    7457         if (!title.isEmpty())
    7458             return title;
    7459     }
    7460 
    7461     auto title = document().title();
     7456    auto title = String(attributeWithoutSynchronization(titleAttr)).stripWhiteSpace().simplifyWhiteSpace();
    74627457    if (!title.isEmpty())
    74637458        return title;
    74647459
    7465     return m_currentSrc.host();
     7460    title = document().title().stripWhiteSpace().simplifyWhiteSpace();
     7461    if (!title.isEmpty())
     7462        return title;
     7463
     7464    title = m_currentSrc.host();
     7465#if PLATFORM(MAC) || PLATFORM(IOS)
     7466    if (!title.isEmpty())
     7467        title = decodeHostName(title);
     7468#endif
     7469#if ENABLE(PUBLIC_SUFFIX_LIST)
     7470    if (!title.isEmpty()) {
     7471        auto domain = topPrivatelyControlledDomain(title);
     7472        if (!domain.isEmpty())
     7473            title = domain;
     7474    }
     7475#endif
     7476
     7477    return title;
    74667478}
    74677479
  • trunk/Source/WebCore/platform/PublicSuffix.h

    r231997 r232001  
    3535WEBCORE_EXPORT bool isPublicSuffix(const String& domain);
    3636WEBCORE_EXPORT String topPrivatelyControlledDomain(const String& domain);
     37String decodeHostName(const String& domain);
    3738
    3839} // namespace WebCore
  • trunk/Source/WebCore/platform/mac/PublicSuffixMac.mm

    r231997 r232001  
    6161}
    6262
     63String decodeHostName(const String& domain)
     64{
     65    return decodeHostName(static_cast<NSString*>(domain));
     66}
     67
    6368}
    6469
Note: See TracChangeset for help on using the changeset viewer.