| Summary: | A YouTube video gets stuck after rapidly tapping on touchbar’s PIP button | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| Product: | WebKit | Reporter: | Peng Liu <peng.liu6> | ||||||||
| Component: | Media | Assignee: | Peng Liu <peng.liu6> | ||||||||
| Status: | RESOLVED FIXED | ||||||||||
| Severity: | Normal | CC: | darin, eric.carlson, ews-watchlist, glenn, jer.noble, philipj, sergio, webkit-bug-importer | ||||||||
| Priority: | P2 | Keywords: | InRadar | ||||||||
| Version: | Safari Technology Preview | ||||||||||
| Hardware: | Mac | ||||||||||
| OS: | Unspecified | ||||||||||
| Bug Depends on: | 202425 | ||||||||||
| Bug Blocks: | |||||||||||
| Attachments: |
|
||||||||||
|
Description
Peng Liu
2020-06-03 21:55:36 PDT
*** Bug 212727 has been marked as a duplicate of this bug. *** *** Bug 212728 has been marked as a duplicate of this bug. *** Created attachment 400996 [details]
Patch
Comment on attachment 400996 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=400996&action=review > Source/WebCore/platform/cocoa/PlaybackSessionModelMediaElement.mm:37 > #import "HTMLElement.h" > #import "HTMLMediaElement.h" > +#import "HTMLVideoElement.h" Don’t need HTMLElement.h or HTMLMediaElement.h if we are including HTMLVideoElement.h. > Source/WebCore/platform/cocoa/PlaybackSessionModelMediaElement.mm:319 > + ASSERT(is<HTMLVideoElement>(*m_mediaElement)); > + if (is<HTMLVideoElement>(*m_mediaElement)) { I’d do early return rather than nesting everything in an if statement. > Source/WebCore/platform/cocoa/PlaybackSessionModelMediaElement.mm:320 > + HTMLVideoElement& asVideo = downcast<HTMLVideoElement>(*m_mediaElement); I’d write this: auto& element = downcast<HTMLVideoElement>(*m_mediaElement); And then I would use element exclusively in the rest of the function, and not use m_mediaElement at all. Created attachment 401111 [details]
Revise the patch based on Darin's comments
Created attachment 401112 [details]
Revise the patch based on Darin's comments - prepare for landing
Comment on attachment 400996 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=400996&action=review >> Source/WebCore/platform/cocoa/PlaybackSessionModelMediaElement.mm:37 >> +#import "HTMLVideoElement.h" > > Don’t need HTMLElement.h or HTMLMediaElement.h if we are including HTMLVideoElement.h. Right. Fixed. >> Source/WebCore/platform/cocoa/PlaybackSessionModelMediaElement.mm:319 >> + if (is<HTMLVideoElement>(*m_mediaElement)) { > > I’d do early return rather than nesting everything in an if statement. Good point. Updated the patch. >> Source/WebCore/platform/cocoa/PlaybackSessionModelMediaElement.mm:320 >> + HTMLVideoElement& asVideo = downcast<HTMLVideoElement>(*m_mediaElement); > > I’d write this: > > auto& element = downcast<HTMLVideoElement>(*m_mediaElement); > > And then I would use element exclusively in the rest of the function, and not use m_mediaElement at all. Make sense! Updated the patch. Committed r262599: <https://trac.webkit.org/changeset/262599> All reviewed patches have been landed. Closing bug and clearing flags on attachment 401112 [details]. |