WebKit Bugzilla
Attachment 340762 Details for
Bug 185680
: Improve NowPlaying "title"
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Respond to post-review comments
bug-185680-20180518174335.patch (text/plain), 3.63 KB, created by
Eric Carlson
on 2018-05-18 17:43:35 PDT
(
hide
)
Description:
Respond to post-review comments
Filename:
MIME Type:
Creator:
Eric Carlson
Created:
2018-05-18 17:43:35 PDT
Size:
3.63 KB
patch
obsolete
>Subversion Revision: 231983 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index ef77cb83859a3bc9b332867e0a88dea75276f71a..9c8dfd733fb0c8fb511d16583e89c4cb872b0896 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,19 @@ >+2018-05-18 Eric Carlson <eric.carlson@apple.com> >+ >+ Improve NowPlaying "title" >+ https://bugs.webkit.org/show_bug.cgi?id=185680 >+ <rdar://problem/40296700> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * 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. >+ > 2018-05-18 Jer Noble <jer.noble@apple.com> > > Complete fix for enabling modern EME by default >diff --git a/Source/WebCore/html/HTMLMediaElement.cpp b/Source/WebCore/html/HTMLMediaElement.cpp >index 6c6ee240fafa673021a273b4afcca8917bb9eff7..b817da21df1ea6e9a5fc5ca8b91e7ca5cbf5111c 100644 >--- a/Source/WebCore/html/HTMLMediaElement.cpp >+++ b/Source/WebCore/html/HTMLMediaElement.cpp >@@ -72,6 +72,7 @@ > #include "PageGroup.h" > #include "PlatformMediaSessionManager.h" > #include "ProgressTracker.h" >+#include "PublicSuffix.h" > #include "RenderLayerCompositor.h" > #include "RenderTheme.h" > #include "RenderVideo.h" >@@ -7452,17 +7453,25 @@ String HTMLMediaElement::mediaSessionTitle() const > if (!document().page() || document().page()->usesEphemeralSession()) > return emptyString(); > >- if (hasAttributeWithoutSynchronization(titleAttr)) { >- auto title = attributeWithoutSynchronization(titleAttr); >- if (!title.isEmpty()) >- return title; >- } >+ auto title = String(attributeWithoutSynchronization(titleAttr)).stripWhiteSpace().simplifyWhiteSpace(); >+ if (!title.isEmpty()) >+ return title; > >- auto title = document().title(); >+ title = document().title().stripWhiteSpace().simplifyWhiteSpace(); > if (!title.isEmpty()) > return title; > >- return m_currentSrc.host(); >+ title = m_currentSrc.host(); >+#if ENABLE(PUBLIC_SUFFIX_LIST) >+ if (!title.isEmpty()) { >+ title = decodeHostName(title); >+ auto domain = topPrivatelyControlledDomain(title); >+ if (!domain.isEmpty()) >+ title = domain; >+ } >+#endif >+ >+ return title; > } > > uint64_t HTMLMediaElement::mediaSessionUniqueIdentifier() const >diff --git a/Source/WebCore/platform/PublicSuffix.h b/Source/WebCore/platform/PublicSuffix.h >index f7ee973ce77f316e7235a41ea00c662c04d652bf..22a539ae9d17461308323ed99e07f683cf121d10 100644 >--- a/Source/WebCore/platform/PublicSuffix.h >+++ b/Source/WebCore/platform/PublicSuffix.h >@@ -34,6 +34,7 @@ namespace WebCore { > > WEBCORE_EXPORT bool isPublicSuffix(const String& domain); > WEBCORE_EXPORT String topPrivatelyControlledDomain(const String& domain); >+String decodeHostName(const String& domain); > > } // namespace WebCore > >diff --git a/Source/WebCore/platform/mac/PublicSuffixMac.mm b/Source/WebCore/platform/mac/PublicSuffixMac.mm >index 1a8c8f15f50886470a6fbaf54d830b6b3eb0cd93..8cb310fa3e4d35354664af7122b4c5772847eda8 100644 >--- a/Source/WebCore/platform/mac/PublicSuffixMac.mm >+++ b/Source/WebCore/platform/mac/PublicSuffixMac.mm >@@ -60,6 +60,12 @@ String topPrivatelyControlledDomain(const String& domain) > return String(); > } > >+String decodeHostName(const String& domain) >+{ >+ RetainPtr<NSString> nsstring = adoptNS((NSString *)domain); >+ return decodeHostName(nsstring.get()); >+} >+ > } > > #endif
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Flags:
dino
:
review+
ews-watchlist
:
commit-queue-
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 185680
:
340504
|
340762
|
340763
|
340764
|
340766
|
340767
|
340769
|
340786
|
340880