RESOLVED FIXED 143720
Media elements not in a page shouldn't load
https://bugs.webkit.org/show_bug.cgi?id=143720
Summary Media elements not in a page shouldn't load
Brady Eidson
Reported 2015-04-14 12:51:19 PDT
Media elements not in a page shouldn't load
Attachments
Patch v1 (2.23 KB, patch)
2015-04-14 12:56 PDT, Brady Eidson
jer.noble: review+
jer.noble: commit-queue-
Patch for landing (2.82 KB, patch)
2015-04-14 13:03 PDT, Brady Eidson
no flags
Real patch for landing. (1.35 KB, patch)
2015-04-14 13:15 PDT, Brady Eidson
beidson: commit-queue-
Land it (1.34 KB, patch)
2015-04-14 13:35 PDT, Brady Eidson
no flags
Brady Eidson
Comment 1 2015-04-14 12:51:36 PDT
Noticed while working on an unrelated patch. Have no test to reproduce.
Brady Eidson
Comment 2 2015-04-14 12:56:30 PDT
Created attachment 250727 [details] Patch v1
Jer Noble
Comment 3 2015-04-14 12:58:19 PDT
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()))
Brady Eidson
Comment 4 2015-04-14 12:59:50 PDT
(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!
Brady Eidson
Comment 5 2015-04-14 13:00:19 PDT
(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*
Brady Eidson
Comment 6 2015-04-14 13:03:14 PDT
We found another one we discussed on IRC.
Brady Eidson
Comment 7 2015-04-14 13:03:32 PDT
Created attachment 250729 [details] Patch for landing
WebKit Commit Bot
Comment 8 2015-04-14 13:04:39 PDT
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.
Brady Eidson
Comment 9 2015-04-14 13:15:07 PDT
Created attachment 250731 [details] Real patch for landing. Disagreement on the media session parts - landing only the loadResource part.
Darin Adler
Comment 10 2015-04-14 13:21:28 PDT
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().
Brady Eidson
Comment 11 2015-04-14 13:33:33 PDT
(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.
Brady Eidson
Comment 12 2015-04-14 13:35:13 PDT
WebKit Commit Bot
Comment 13 2015-04-14 14:25:47 PDT
Comment on attachment 250734 [details] Land it Clearing flags on attachment: 250734 Committed r182810: <http://trac.webkit.org/changeset/182810>
WebKit Commit Bot
Comment 14 2015-04-14 14:25:50 PDT
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.