It is sometimes desirable for the MediaPlayer to access information about its owning document. Currently there is a method MediaPlayer::frameView(), which returns the FrameView which renders the MediaPlayer. However, there are some situations where a renderer is not created for a Media element, and as such there is no way for the MediaPlayer to access its owning document. An example of one of these situations can be seen here: http://people.freedesktop.org/~company/stuff/video-demo.html (Credit goes to Bug 30679 for this link) In this demonstration, the video elements are never added to the DOM, so a renderer is never created. As discussed in Bug 35328, the proposed solution is to add a MediaPlayerClient::mediaPlayerOwningDocument(). A patch is coming.
Created attachment 49458 [details] Initial Patch
Comment on attachment 49458 [details] Initial Patch Clearing flags on attachment: 49458 Committed r55225: <http://trac.webkit.org/changeset/55225>
All reviewed patches have been landed. Closing bug.
Comment on attachment 49458 [details] Initial Patch > +Document* HTMLMediaElement::mediaPlayerOwningDocument() > +{ > + Document* d = document(); > + > + if (!d) > + d = ownerDocument(); > + > + return d; > +} The implementation of this function is needlessly complex. The Node::document() function never returns 0 for an element, and ownerDocument() always returns the same thing as document() except when ownerDocument() returns 0.