Bug 51752 - Make retrieving extraMediaControlsStyleSheet be page dependent
Summary: Make retrieving extraMediaControlsStyleSheet be page dependent
Alias: None
Product: WebKit
Classification: Unclassified
Component: Media (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Yi Shen
Depends on:
Reported: 2010-12-30 08:52 PST by Yi Shen
Modified: 2011-01-03 05:40 PST (History)
7 users (show)

See Also:

first try (1.80 KB, patch)
2010-12-30 08:58 PST, Yi Shen
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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

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>