Bug 51752

Summary: Make retrieving extraMediaControlsStyleSheet be page dependent
Product: WebKit Reporter: Yi Shen <max.hong.shen>
Component: MediaAssignee: Yi Shen <max.hong.shen>
Status: RESOLVED FIXED    
Severity: Normal CC: ademar, commit-queue, jer.noble, kling, laszlo.gombos, nancy.piedra, tonikitoo
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: All   
OS: All   
Attachments:
Description Flags
first try none

Description Yi Shen 2010-12-30 08:52:01 PST
For media element, cssstyleselector loads the media controls style-sheet by using defaultTheme, which assumes the theme is needed in non-page dependent code. However, we may need to load a page dependent theme. For example, if the browser runs in a force-fullscreen-mode, (see https://bugs.webkit.org/show_bug.cgi?id=51133) then the theme of the media controls might be changed a bit. To change the theme, one possible solution is to load a different style sheet for the force-fullscreen-mode. Considering following code

String RenderThemeQt::extraMediaControlsStyleSheet()
{
    String result = String(mediaControlsQtUserAgentStyleSheet, sizeof(mediaControlsQtUserAgentStyleSheet));
    if (m_page && m_page->chrome()->requiresFullscreenForVideoPlayback())
        result += String(mediaControlsQtFullscreenUserAgentStyleSheet, sizeof(mediaControlsQtFullscreenUserAgentStyleSheet));
    return result;
}

To make above code work, we have to use themeForPage (which passes a page pointer to the RenderThemeQt) to retrieve extraMediaControlsStyleSheet.
Comment 1 Yi Shen 2010-12-30 08:58:59 PST
Created attachment 77683 [details]
first try
Comment 2 Eric Seidel (no email) 2010-12-31 09:08:44 PST
Comment on attachment 77683 [details]
first try

OK
Comment 3 WebKit Commit Bot 2010-12-31 09:58:48 PST
Comment on attachment 77683 [details]
first try

Clearing flags on attachment: 77683

Committed r74832: <http://trac.webkit.org/changeset/74832>
Comment 4 WebKit Commit Bot 2010-12-31 09:58:54 PST
All reviewed patches have been landed.  Closing bug.
Comment 5 Ademar Reis 2011-01-03 05:40:19 PST
Revision r74832 cherry-picked into qtwebkit-2.2 with commit 5b7ebdc <http://gitorious.org/webkit/qtwebkit/commit/5b7ebdc>