[Webkit-unassigned] [Bug 172881] Modify Netflix controlsManager quirk to prevent only scrubbing

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Sat Jun 3 11:45:41 PDT 2017


https://bugs.webkit.org/show_bug.cgi?id=172881

--- Comment #6 from Andy Estes <aestes at apple.com> ---
(In reply to Eric Carlson from comment #5)
> (In reply to Andy Estes from comment #3)
> > Comment on attachment 311887 [details]
> > 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] != '.';
> 
> Isn't it possible for host.length to be smaller than netflixDomain.length?

We already know that host ends with netflixDomain at this point, so it must be at least as long as netflixDomain.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20170603/e5788321/attachment.html>


More information about the webkit-unassigned mailing list