Changeset 64401 in webkit


Ignore:
Timestamp:
Jul 30, 2010 7:46:16 PM (14 years ago)
Author:
commit-queue@webkit.org
Message:

2010-07-30 Luiz Agostini <luiz.agostini@openbossa.org>

Reviewed by Simon Fraser.

Enabling view modes to all platforms
https://bugs.webkit.org/show_bug.cgi?id=37505

Removing ENABLE_WIDGETS_10_SUPPORT flag.

As view mode media feature is not part of widget 1.0 specification
any more the ENABLE_WIDGETS_10_SUPPORT flag may be removed. The only use
of this flag was related to view mode media feature implementation in Qt.

  • wtf/Platform.h:

2010-07-30 Luiz Agostini <luiz.agostini@openbossa.org>

Reviewed by Simon Fraser.

Enabling view modes to all platforms
https://bugs.webkit.org/show_bug.cgi?id=37505

Removing 'widget' reference from the layout tests because the view mode media feature
is not part of widget 1.0 specification any more.

The layout tests are stil skipped for all platforms except Qt because of the lack
of support of LayoutTestController in those platforms.

  • fast/media/view-mode-media-feature-expected.txt: Renamed from LayoutTests/fast/media/media-feature-wgt-view-mode-expected.txt.
  • fast/media/view-mode-media-feature.html: Renamed from LayoutTests/fast/media/media-feature-wgt-view-mode.html.
  • platform/gtk/Skipped:
  • platform/mac/Skipped:
  • platform/win/Skipped:

2010-07-30 Luiz Agostini <luiz.agostini@openbossa.org>

Reviewed by Simon Fraser.

Enabling view modes to all platforms
https://bugs.webkit.org/show_bug.cgi?id=37505

View mode media feature implementation as specified in http://www.w3.org/TR/view-mode.

The view mode media feature layout tests are stil skipped for all platforms except Qt
because of the lack of support of LayoutTestController in those platforms.

Test: fast/media/view-mode-media-feature.html

  • css/MediaFeatureNames.h:
  • css/MediaQueryEvaluator.cpp: (WebCore::view_modeMediaFeatureEval):
  • page/ChromeClient.h:
  • page/Page.cpp: (WebCore::Page::Page): (WebCore::createViewModesSet): (WebCore::Page::setViewMode):
  • page/Page.h: (WebCore::Page::viewMode):

2010-07-30 Luiz Agostini <luiz.agostini@openbossa.org>

Reviewed by Simon Fraser.

Enabling view modes to all platforms
https://bugs.webkit.org/show_bug.cgi?id=37505

As view mode media feature is now supported by WebCore there is no need
to keep its implementation here. QtWebKit now uses WebCore's view mode media feature
implementation.

  • Api/qwebpage.cpp: (QWebPagePrivate::dynamicPropertyChangeEvent):
  • Api/qwebpage_p.h:
  • WebCoreSupport/ChromeClientQt.cpp:
  • WebCoreSupport/ChromeClientQt.h:
Location:
trunk
Files:
17 edited
2 moved

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/ChangeLog

    r64390 r64401  
     12010-07-30  Luiz Agostini  <luiz.agostini@openbossa.org>
     2
     3        Reviewed by Simon Fraser.
     4
     5        Enabling view modes to all platforms
     6        https://bugs.webkit.org/show_bug.cgi?id=37505
     7
     8        Removing ENABLE_WIDGETS_10_SUPPORT flag.
     9
     10        As view mode media feature is not part of widget 1.0 specification
     11        any more the ENABLE_WIDGETS_10_SUPPORT flag may be removed. The only use
     12        of this flag was related to view mode media feature implementation in Qt.
     13
     14        * wtf/Platform.h:
     15
    1162010-07-30  Andy Estes  <aestes@apple.com>
    217
  • trunk/JavaScriptCore/wtf/Platform.h

    r64183 r64401  
    572572#if PLATFORM(QT)
    573573#define WTF_USE_QT4_UNICODE 1
    574 #if !defined(ENABLE_WIDGETS_10_SUPPORT)
    575 #define ENABLE_WIDGETS_10_SUPPORT 1
    576 #endif
    577574#elif OS(WINCE)
    578575#define WTF_USE_WINCE_UNICODE 1
     
    838835#endif
    839836
    840 #if !defined(ENABLE_WIDGETS_10_SUPPORT)
    841 #define ENABLE_WIDGETS_10_SUPPORT 0
    842 #endif
    843 
    844837#if !defined(ENABLE_INSPECTOR)
    845838#define ENABLE_INSPECTOR 1
  • trunk/LayoutTests/ChangeLog

    r64395 r64401  
     12010-07-30  Luiz Agostini  <luiz.agostini@openbossa.org>
     2
     3        Reviewed by Simon Fraser.
     4
     5        Enabling view modes to all platforms
     6        https://bugs.webkit.org/show_bug.cgi?id=37505
     7
     8        Removing 'widget' reference from the layout tests because the view mode media feature
     9        is not part of widget 1.0 specification any more.
     10
     11        The layout tests are stil skipped for all platforms except Qt because of the lack
     12        of support of LayoutTestController in those platforms.
     13
     14        * fast/media/view-mode-media-feature-expected.txt: Renamed from LayoutTests/fast/media/media-feature-wgt-view-mode-expected.txt.
     15        * fast/media/view-mode-media-feature.html: Renamed from LayoutTests/fast/media/media-feature-wgt-view-mode.html.
     16        * platform/gtk/Skipped:
     17        * platform/mac/Skipped:
     18        * platform/win/Skipped:
     19
    1202010-07-30  Andrew Wilson  <atwilson@chromium.org>
    221
  • trunk/LayoutTests/fast/media/view-mode-media-feature.html

    r64400 r64401  
    11<head>
    2     <title>Testing Widgets 1.0 View Mode Media Feature</title>
     2    <title>Testing the View Mode Media Feature</title>
    33    <style type="text/css">
    44        div {
  • trunk/LayoutTests/platform/gtk/Skipped

    r64388 r64401  
    54575457fast/runin/generated4.html
    54585458
    5459 # No Widgets 1.0 support
    5460 fast/media/media-feature-wgt-view-mode.html
     5459# view mode media feature
     5460fast/media/view-mode-media-feature.html
    54615461
    54625462# MediaPlayerPrivateGStreamer doesn't return to NETWORK_IDLE and hence doesn't fire a suspend event
  • trunk/LayoutTests/platform/mac/Skipped

    r64388 r64401  
    140140fast/media/print-restores-previous-mediatype.html
    141141
    142 # No Widgets 1.0 support
    143 fast/media/media-feature-wgt-view-mode.html
     142# view mode media feature
     143fast/media/view-mode-media-feature.html
    144144
    145145# Test is flaky and thus not useful until fixed.
  • trunk/LayoutTests/platform/win/Skipped

    r64388 r64401  
    838838fast/dom/HTMLMeterElement/meter-styles-changing-pseudo.html
    839839
    840 # No Widgets 1.0 support
    841 fast/media/media-feature-wgt-view-mode.html
     840# view mode media feature
     841fast/media/view-mode-media-feature.html
    842842
    843843# Need expectations. See https://bugs.webkit.org/show_bug.cgi?id=36461
  • trunk/WebCore/ChangeLog

    r64400 r64401  
     12010-07-30  Luiz Agostini  <luiz.agostini@openbossa.org>
     2
     3        Reviewed by Simon Fraser.
     4
     5        Enabling view modes to all platforms
     6        https://bugs.webkit.org/show_bug.cgi?id=37505
     7
     8        View mode media feature implementation as specified in http://www.w3.org/TR/view-mode.
     9
     10        The view mode media feature layout tests are stil skipped for all platforms except Qt
     11        because of the lack of support of LayoutTestController in those platforms.
     12
     13        Test: fast/media/view-mode-media-feature.html
     14
     15        * css/MediaFeatureNames.h:
     16        * css/MediaQueryEvaluator.cpp:
     17        (WebCore::view_modeMediaFeatureEval):
     18        * page/ChromeClient.h:
     19        * page/Page.cpp:
     20        (WebCore::Page::Page):
     21        (WebCore::createViewModesSet):
     22        (WebCore::Page::setViewMode):
     23        * page/Page.h:
     24        (WebCore::Page::viewMode):
     25
    1262010-07-30  Joseph Pecoraro  <joepeck@webkit.org>
    227
  • trunk/WebCore/css/MediaFeatureNames.h

    r56740 r64401  
    2525namespace WebCore {
    2626    namespace MediaFeatureNames {
    27 
    28 #if ENABLE(WIDGETS_10_SUPPORT)
    29 #define CSS_MEDIAQUERY_NAMES_FOR_WIDGETS_10_MEDIAFEATURE(macro) \
    30     macro(view_mode, "-webkit-view-mode")
    31 #else
    32 #define CSS_MEDIAQUERY_NAMES_FOR_WIDGETS_10_MEDIAFEATURE(macro)
    33 #endif
    3427
    3528#define CSS_MEDIAQUERY_NAMES_FOR_EACH_MEDIAFEATURE(macro) \
     
    6760    macro(transition, "-webkit-transition") \
    6861    macro(animation, "-webkit-animation") \
    69     CSS_MEDIAQUERY_NAMES_FOR_WIDGETS_10_MEDIAFEATURE(macro)
     62    macro(view_mode, "-webkit-view-mode")
    7063
    7164// end of macro
  • trunk/WebCore/css/MediaQueryEvaluator.cpp

    r61016 r64401  
    499499}
    500500
    501 #if ENABLE(WIDGETS_10_SUPPORT)
    502501static bool view_modeMediaFeatureEval(CSSValue* value, RenderStyle*, Frame* frame, MediaFeaturePrefix op)
    503502{
    504     if (value) {
    505         String mode = static_cast<CSSPrimitiveValue*>(value)->getStringValue();
    506         if (ChromeClient* client = frame->page()->chrome()->client()) {
    507             if (mode == "windowed" && client->isWindowed())
    508                 return true;
    509             if (mode == "floating" && client->isFloating())
    510                 return true;
    511             if (mode == "fullscreen" && client->isFullscreen())
    512                 return true;
    513             if (mode == "maximized" && client->isMaximized())
    514                 return true;
    515             if (mode == "minimized" && client->isMinimized())
    516                 return true;
    517             return false;
    518         }
    519     }
    520     return true;
    521 }
    522 #endif
     503    UNUSED_PARAM(op);
     504    if (!value)
     505        return true;
     506    return Page::stringToViewMode(static_cast<CSSPrimitiveValue*>(value)->getStringValue()) == frame->page()->viewMode();
     507}
    523508
    524509static void createFunctionMap()
  • trunk/WebCore/page/ChromeClient.h

    r64400 r64401  
    263263#endif
    264264
    265 #if ENABLE(WIDGETS_10_SUPPORT)
    266         virtual bool isWindowed() { return false; }
    267         virtual bool isFloating() { return false; }
    268         virtual bool isFullscreen() { return false; }
    269         virtual bool isMaximized() { return false; }
    270         virtual bool isMinimized() { return false; }
    271 #endif
    272 
    273265    protected:
    274266        virtual ~ChromeClient() { }
  • trunk/WebCore/page/Page.cpp

    r64293 r64401  
    168168    , m_customHTMLTokenizerChunkSize(-1)
    169169    , m_canStartMedia(true)
     170    , m_viewMode(ViewModeWindowed)
    170171{
    171172    if (!allPages) {
     
    219220    Frame::cancelAllKeepAlive();
    220221#endif
     222}
     223
     224struct ViewModeInfo {
     225    const char* name;
     226    Page::ViewMode type;
     227};
     228static const int viewModeMapSize = 5;
     229static ViewModeInfo viewModeMap[viewModeMapSize] = {
     230    {"windowed", Page::ViewModeWindowed},
     231    {"floating", Page::ViewModeFloating},
     232    {"fullscreen", Page::ViewModeFullscreen},
     233    {"maximized", Page::ViewModeMaximized},
     234    {"minimized", Page::ViewModeMinimized}
     235};
     236
     237Page::ViewMode Page::stringToViewMode(const String& text)
     238{
     239    for (int i = 0; i < viewModeMapSize; ++i) {
     240        if (text == viewModeMap[i].name)
     241            return viewModeMap[i].type;
     242    }
     243    return Page::ViewModeInvalid;
     244}
     245
     246void Page::setViewMode(ViewMode viewMode)
     247{
     248    if (viewMode == m_viewMode || viewMode == ViewModeInvalid)
     249        return;
     250
     251    m_viewMode = viewMode;
     252
     253    if (!m_mainFrame)
     254        return;
     255
     256    if (m_mainFrame->view())
     257        m_mainFrame->view()->forceLayout();
     258
     259    if (m_mainFrame->document())
     260        m_mainFrame->document()->updateStyleSelector();
    221261}
    222262
  • trunk/WebCore/page/Page.h

    r64208 r64401  
    187187        Settings* settings() const { return m_settings.get(); }
    188188        ProgressTracker* progress() const { return m_progress.get(); }
     189
     190
     191        enum ViewMode {
     192            ViewModeInvalid,
     193            ViewModeWindowed,
     194            ViewModeFloating,
     195            ViewModeFullscreen,
     196            ViewModeMaximized,
     197            ViewModeMinimized
     198        };
     199        static ViewMode stringToViewMode(const String&);
     200
     201        ViewMode viewMode() const { return m_viewMode; }
     202        void setViewMode(ViewMode);
    189203       
    190204        void setTabKeyCyclesThroughElements(bool b) { m_tabKeyCyclesThroughElements = b; }
     
    362376        NotificationPresenter* m_notificationPresenter;
    363377#endif
     378
     379        ViewMode m_viewMode;
    364380    };
    365381
  • trunk/WebKit/qt/Api/qwebpage.cpp

    r64245 r64401  
    12191219{
    12201220    if (event->propertyName() == "_q_viewMode") {
    1221         QString mode = q->property("_q_viewMode").toString();
    1222         if (mode != viewMode) {
    1223             viewMode = mode;
    1224             WebCore::Frame* frame = QWebFramePrivate::core(q->mainFrame());
    1225             WebCore::FrameView* view = frame->view();
    1226             frame->document()->updateStyleSelector();
    1227             view->layout();
    1228         }
     1221        page->setViewMode(Page::stringToViewMode(q->property("_q_viewMode").toString()));
    12291222    } else if (event->propertyName() == "_q_HTMLTokenizerChunkSize") {
    12301223        int chunkSize = q->property("_q_HTMLTokenizerChunkSize").toInt();
  • trunk/WebKit/qt/Api/qwebpage_p.h

    r64245 r64401  
    202202    bool inspectorIsInternalOnly; // True if created through the Inspect context menu action
    203203    Qt::DropAction m_lastDropAction;
    204    
    205     QString viewMode;
    206204
    207205    static bool drtRun;
  • trunk/WebKit/qt/ChangeLog

    r64400 r64401  
     12010-07-30  Luiz Agostini  <luiz.agostini@openbossa.org>
     2
     3        Reviewed by Simon Fraser.
     4
     5        Enabling view modes to all platforms
     6        https://bugs.webkit.org/show_bug.cgi?id=37505
     7
     8        As view mode media feature is now supported by WebCore there is no need
     9        to keep its implementation here. QtWebKit now uses WebCore's view mode media feature
     10        implementation.
     11
     12        * Api/qwebpage.cpp:
     13        (QWebPagePrivate::dynamicPropertyChangeEvent):
     14        * Api/qwebpage_p.h:
     15        * WebCoreSupport/ChromeClientQt.cpp:
     16        * WebCoreSupport/ChromeClientQt.h:
     17
    1182010-07-30  Joseph Pecoraro  <joepeck@webkit.org>
    219
  • trunk/WebKit/qt/WebCoreSupport/ChromeClientQt.cpp

    r64400 r64401  
    604604}
    605605
    606 #if ENABLE(WIDGETS_10_SUPPORT)
    607 bool ChromeClientQt::isWindowed()
    608 {
    609     return m_webPage->d->viewMode == "windowed";
    610 }
    611 
    612 bool ChromeClientQt::isFloating()
    613 {
    614     return m_webPage->d->viewMode == "floating";
    615 }
    616 
    617 bool ChromeClientQt::isFullscreen()
    618 {
    619     return m_webPage->d->viewMode == "fullscreen";
    620 }
    621 
    622 bool ChromeClientQt::isMaximized()
    623 {
    624     return m_webPage->d->viewMode == "maximized";
    625 }
    626 
    627 bool ChromeClientQt::isMinimized()
    628 {
    629     return m_webPage->d->viewMode == "minimized";
    630 }
    631 #endif
    632 
    633606void ChromeClientQt::didReceiveViewportArguments(Frame* frame, const ViewportArguments& arguments) const
    634607{
  • trunk/WebKit/qt/WebCoreSupport/ChromeClientQt.h

    r64400 r64401  
    170170        virtual void cancelGeolocationPermissionRequestForFrame(Frame*, Geolocation*) { }
    171171
    172 #if ENABLE(WIDGETS_10_SUPPORT)
    173         virtual bool isWindowed();
    174         virtual bool isFloating();
    175         virtual bool isFullscreen();
    176         virtual bool isMaximized();
    177         virtual bool isMinimized();
    178 #endif
    179 
    180172        QtAbstractWebPopup* createSelectPopup();
    181173
Note: See TracChangeset for help on using the changeset viewer.