[Webkit-unassigned] [Bug 113853] Add API in QWebSettings for setting the CSS media type

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Apr 8 04:14:22 PDT 2013


https://bugs.webkit.org/show_bug.cgi?id=113853





--- Comment #8 from Jose Lejin PJ <jose.lejin at gmail.com>  2013-04-08 04:12:35 PST ---
(In reply to comment #7)
> (From update of attachment 196455 [details])
> Did you test this well?
> By reading the code it seems like this only applies to the current FrameView (which is only used for the currently navigated page).
> If you click a link to navigate to a second page, it feels like this setting won't be applied unless you call setMediaTypeOverride again.
> 
> A safer way to implement this would be to do like setMediaStyle is implemented in Source/WebKit/mac/WebView/WebView.mm.
> It could still live in QWebSettings, but instead of forwarding the value to WebCore::Settings, it would be fetched by our implementation of FrameLoaderClientQt::overrideMediaType in Source/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp.


Thanks for the comment. You are right ! It will work for current frame view only.

String FrameView::mediaType() const
{
    // See if we have an override type.
    String overrideType = m_frame->loader()->client()->overrideMediaType();
    InspectorInstrumentation::applyEmulatedMedia(m_frame.get(), &overrideType);
    if (!overrideType.isNull())
        return overrideType;
    return m_mediaType;
}

Since overrideType is coming null, for next frameview "screen" default value set in m_mediaType is taken.


But is this _intentionally_ done ? Example is I am browsing a page in "screen" type and I want to print that page. In browser I will set that to "print" type. When I transition to next page I assume same "screen" type behavior instead "print" css type.

If we get type from FrameLoaderClientQt::overrideMediaType(), next page also will be in "print" css mode. Then it will become opposite to WebCore::Settings behavior. 

Please suggest !
(If application want to retain this css media type, they can do it in page transition by setting again as per need.)

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.


More information about the webkit-unassigned mailing list