[webkit-reviews] review granted: [Bug 172881] Modify Netflix controlsManager quirk to prevent only scrubbing : [Attachment 311887] Patch
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Fri Jun 2 17:15:53 PDT 2017
Andy Estes <aestes at apple.com> has granted Beth Dakin <bdakin at apple.com>'s
request for review:
Bug 172881: Modify Netflix controlsManager quirk to prevent only scrubbing
https://bugs.webkit.org/show_bug.cgi?id=172881
Attachment 311887: Patch
https://bugs.webkit.org/attachment.cgi?id=311887&action=review
--- Comment #3 from Andy Estes <aestes at apple.com> ---
Comment on attachment 311887
--> https://bugs.webkit.org/attachment.cgi?id=311887
Patch
View in context: https://bugs.webkit.org/attachment.cgi?id=311887&action=review
> Source/WebCore/platform/cocoa/WebPlaybackSessionModelMediaElement.mm:533
> + String host = document->url().host();
> + return !(equalLettersIgnoringASCIICase(host, "netflix.com") ||
host.endsWithIgnoringASCIICase(".netflix.com"));
Not new to this patch, but the double string comparison makes me a little sad.
In the past I've done something like this:
String netflixDomain = ASCIILiteral("netflix.com");
if (!host.endsWithIgnoringASCIICase(netflixDomain))
return true;
unsigned suffixOffset = host.length() - netflixDomain.length();
return suffixOffset && host[suffixOffset - 1] != '.';
More information about the webkit-reviews
mailing list