WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
172881
Modify Netflix controlsManager quirk to prevent only scrubbing
https://bugs.webkit.org/show_bug.cgi?id=172881
Summary
Modify Netflix controlsManager quirk to prevent only scrubbing
Beth Dakin
Reported
2017-06-02 16:37:19 PDT
Modify Netflix controlsManager quirk to prevent only scrubbing
rdar://problem/32228660
Attachments
Patch
(19.96 KB, patch)
2017-06-02 16:57 PDT
,
Beth Dakin
aestes
: review+
Details
Formatted Diff
Diff
View All
Add attachment
proposed patch, testcase, etc.
Beth Dakin
Comment 1
2017-06-02 16:57:14 PDT
Created
attachment 311887
[details]
Patch
Build Bot
Comment 2
2017-06-02 17:00:15 PDT
Attachment 311887
[details]
did not pass style-queue: ERROR: Source/WebCore/platform/cocoa/WebPlaybackSessionModelMediaElement.mm:518: Multi line control clauses should use braces. [whitespace/braces] [4] ERROR: Source/WebCore/platform/cocoa/WebPlaybackSessionModelMediaElement.mm:522: Multi line control clauses should use braces. [whitespace/braces] [4] ERROR: Source/WebCore/platform/cocoa/WebPlaybackSessionModelMediaElement.mm:526: Multi line control clauses should use braces. [whitespace/braces] [4] ERROR: Source/WebCore/platform/cocoa/WebPlaybackSessionModelMediaElement.mm:529: Multi line control clauses should use braces. [whitespace/braces] [4] ERROR: Source/WebCore/platform/cocoa/WebPlaybackSessionModelMediaElement.mm:529: Weird number of spaces at line-start. Are you using a 4-space indent? [whitespace/indent] [3] ERROR: Source/WebCore/platform/cocoa/WebPlaybackSessionModelMediaElement.mm:530: When wrapping a line, only indent 4 spaces. [whitespace/indent] [3] ERROR: Source/WebCore/platform/mac/WebPlaybackControlsManager.mm:59: Should not have spaces around = in property synthesis. [whitespace/property] [4] Total errors found: 7 in 15 files If any of these errors are false positives, please file a bug against check-webkit-style.
Andy Estes
Comment 3
2017-06-02 17:15:53 PDT
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] != '.';
Wenson Hsieh
Comment 4
2017-06-02 19:24:43 PDT
Does this mean that Now Playing scrubber controls will now be enabled again for Netflix?
Eric Carlson
Comment 5
2017-06-03 08:26:14 PDT
(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?
Andy Estes
Comment 6
2017-06-03 11:45:41 PDT
(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.
Beth Dakin
Comment 7
2017-06-03 12:24:43 PDT
(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] != '.';
Cool, I'll try this! Thanks Andy!
Beth Dakin
Comment 8
2017-06-03 12:25:17 PDT
(In reply to Wenson Hsieh from
comment #4
)
> Does this mean that Now Playing scrubber controls will now be enabled again > for Netflix?
It means that Netflix will have all of the controls, but if a user tries to use the timeline to scrub, nothing will happen.
Beth Dakin
Comment 9
2017-06-05 13:30:46 PDT
https://trac.webkit.org/changeset/217791/webkit
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug