| Summary: | Media elements not in a page shouldn't load | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Product: | WebKit | Reporter: | Brady Eidson <beidson> | ||||||||||
| Component: | Media | Assignee: | Brady Eidson <beidson> | ||||||||||
| Status: | RESOLVED FIXED | ||||||||||||
| Severity: | Normal | CC: | commit-queue, jer.noble | ||||||||||
| Priority: | P2 | ||||||||||||
| Version: | 528+ (Nightly build) | ||||||||||||
| Hardware: | All | ||||||||||||
| OS: | All | ||||||||||||
| Attachments: |
|
||||||||||||
|
Description
Brady Eidson
2015-04-14 12:51:19 PDT
Noticed while working on an unrelated patch. Have no test to reproduce. Created attachment 250727 [details]
Patch v1
Comment on attachment 250727 [details] Patch v1 View in context: https://bugs.webkit.org/attachment.cgi?id=250727&action=review > Source/WebCore/html/HTMLMediaSession.cpp:146 > - if (m_restrictions & RequirePageConsentToLoadMedia && page && !page->canStartMedia()) { > + if (!page || !page->canStartMedia() || m_restrictions & RequirePageConsentToLoadMedia) { This should be: if (m_restrictions & RequirePageConsentToLoadMedia && (!page || !page->canStartMedia())) (In reply to comment #3) > Comment on attachment 250727 [details] > Patch v1 > > View in context: > https://bugs.webkit.org/attachment.cgi?id=250727&action=review > > > Source/WebCore/html/HTMLMediaSession.cpp:146 > > - if (m_restrictions & RequirePageConsentToLoadMedia && page && !page->canStartMedia()) { > > + if (!page || !page->canStartMedia() || m_restrictions & RequirePageConsentToLoadMedia) { > > This should be: if (m_restrictions & RequirePageConsentToLoadMedia && (!page > || !page->canStartMedia())) Kinda. The page checks should be first. But the joining clause after them *should* be an or. Thanks! (In reply to comment #4) > Kinda. > > The page checks should be first. > > But the joining clause after them *should* be an or. > I meant it should be an and. *sigh* We found another one we discussed on IRC. Created attachment 250729 [details]
Patch for landing
Attachment 250729 [details] did not pass style-queue:
ERROR: Source/WebCore/ChangeLog:1: ChangeLog entry has no bug number [changelog/bugnumber] [5]
Total errors found: 1 in 3 files
If any of these errors are false positives, please file a bug against check-webkit-style.
Created attachment 250731 [details]
Real patch for landing.
Disagreement on the media session parts - landing only the loadResource part.
Comment on attachment 250727 [details] Patch v1 View in context: https://bugs.webkit.org/attachment.cgi?id=250727&action=review > Source/WebCore/html/HTMLMediaElement.cpp:1093 > + if (!frame->mainFrame().page()) { Should just be frame->page(). (In reply to comment #10) > Comment on attachment 250727 [details] > Patch v1 > > View in context: > https://bugs.webkit.org/attachment.cgi?id=250727&action=review > > > Source/WebCore/html/HTMLMediaElement.cpp:1093 > > + if (!frame->mainFrame().page()) { > > Should just be frame->page(). Yup, you're definitely correct. Brain dead copy mistake. Created attachment 250734 [details]
Land it
Comment on attachment 250734 [details] Land it Clearing flags on attachment: 250734 Committed r182810: <http://trac.webkit.org/changeset/182810> All reviewed patches have been landed. Closing bug. |