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.
Created attachment 77683 [details] first try
Comment on attachment 77683 [details] first try OK
Comment on attachment 77683 [details] first try Clearing flags on attachment: 77683 Committed r74832: <http://trac.webkit.org/changeset/74832>
All reviewed patches have been landed. Closing bug.
Revision r74832 cherry-picked into qtwebkit-2.2 with commit 5b7ebdc <http://gitorious.org/webkit/qtwebkit/commit/5b7ebdc>