Changeset 99155 in webkit


Ignore:
Timestamp:
Nov 3, 2011 2:56:33 AM (12 years ago)
Author:
commit-queue@webkit.org
Message:

[EFL] Enable the Page Visibility API.
https://bugs.webkit.org/show_bug.cgi?id=69127

Patch by Dongwoo Im <dw.im@samsung.com> on 2011-11-03
Reviewed by Adam Barth.

.:

Build system changes to support ENABLE(PAGE_VISIBILITY_API) on EFL port.

  • Source/cmake/OptionsEfl.cmake: Add enabled ENABLE_PAGE_VISIBILITY_API definition.
  • Source/cmakeconfig.h.cmake: ditto.

Source/WebKit/efl:

Implement methods to enable the Page Visibility API on EFL port.
(http://www.w3.org/TR/page-visibility)

When the visibility status of the page is changed, browser could
inform the status to WebKit using the APIs below.

  • ewk/ewk_view.cpp: Add setter/getter functions to query/set page visibility state.

(ewk_view_visibility_state_set): Sets the page visibility status.
(ewk_view_visibility_state_get): Gets the page visibility status.

  • ewk/ewk_view.h: Add public prototypes.

LayoutTests:

  • platform/efl/Skipped: Unskip all of the test cases of page visibility.
Location:
trunk
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/ChangeLog

    r98793 r99155  
     12011-11-03  Dongwoo Im  <dw.im@samsung.com>
     2
     3        [EFL] Enable the Page Visibility API.
     4        https://bugs.webkit.org/show_bug.cgi?id=69127
     5
     6        Reviewed by Adam Barth.
     7
     8        Build system changes to support ENABLE(PAGE_VISIBILITY_API) on EFL port.
     9
     10        * Source/cmake/OptionsEfl.cmake: Add enabled ENABLE_PAGE_VISIBILITY_API definition.
     11        * Source/cmakeconfig.h.cmake: ditto.
     12
    1132011-10-28  Adam Barth  <abarth@webkit.org>
    214
  • trunk/LayoutTests/ChangeLog

    r99153 r99155  
     12011-11-03  Dongwoo Im  <dw.im@samsung.com>
     2
     3        [EFL] Enable the Page Visibility API.
     4        https://bugs.webkit.org/show_bug.cgi?id=69127
     5
     6        Reviewed by Adam Barth.
     7
     8        * platform/efl/Skipped: Unskip all of the test cases of page visibility.
     9
    1102011-11-03  Andrey Kosyakov  <caseq@chromium.org>
    211
  • trunk/LayoutTests/platform/efl/Skipped

    r98867 r99155  
    10811081webarchive
    10821082
    1083 # The EFL port has no support for the Page Visibility API
    1084 fast/events/page-visibility-iframe-delete-test.html
    1085 fast/events/page-visibility-iframe-move-test.html
    1086 fast/events/page-visibility-iframe-propagation-test.html
    1087 fast/events/page-visibility-transition-test.html
    1088 
    10891083# The EFL port has no support for webtiming
    10901084fast/dom/Window/window-properties-performance.html
  • trunk/Source/WebKit/efl/ChangeLog

    r99096 r99155  
     12011-11-03  Dongwoo Im  <dw.im@samsung.com>
     2
     3        [EFL] Enable the Page Visibility API.
     4        https://bugs.webkit.org/show_bug.cgi?id=69127
     5
     6        Reviewed by Adam Barth.
     7
     8        Implement methods to enable the Page Visibility API on EFL port.
     9        (http://www.w3.org/TR/page-visibility)
     10
     11        When the visibility status of the page is changed, browser could
     12        inform the status to WebKit using the APIs below.
     13
     14        * ewk/ewk_view.cpp: Add setter/getter functions to query/set page visibility state.
     15        (ewk_view_visibility_state_set): Sets the page visibility status.
     16        (ewk_view_visibility_state_get): Gets the page visibility status.
     17        * ewk/ewk_view.h: Add public prototypes.
     18
    1192011-11-02  Tom Sepez  <tsepez@chromium.org>
    220
  • trunk/Source/WebKit/efl/ewk/ewk_view.cpp

    r98908 r99155  
    38753875}
    38763876
     3877Eina_Bool ewk_view_visibility_state_set(Evas_Object* ewkView, Ewk_Page_Visibility_State pageVisibleState, Eina_Bool initialState)
     3878{
     3879#if ENABLE(PAGE_VISIBILITY_API)
     3880    EWK_VIEW_SD_GET_OR_RETURN(ewkView, smartData, EINA_FALSE);
     3881    EWK_VIEW_PRIV_GET_OR_RETURN(smartData, priv, EINA_FALSE);
     3882
     3883    switch (pageVisibleState) {
     3884    case EWK_PAGE_VISIBILITY_STATE_VISIBLE:
     3885        priv->page->setVisibilityState(WebCore::PageVisibilityStateVisible, initialState);
     3886        break;
     3887    case EWK_PAGE_VISIBILITY_STATE_HIDDEN:
     3888        priv->page->setVisibilityState(WebCore::PageVisibilityStateHidden, initialState);
     3889        break;
     3890    case EWK_PAGE_VISIBILITY_STATE_PRERENDER:
     3891        priv->page->setVisibilityState(WebCore::PageVisibilityStatePrerender, initialState);
     3892        break;
     3893    default:
     3894        return EINA_FALSE;
     3895    }
     3896
     3897    return EINA_TRUE;
     3898#else
     3899    DBG("PAGE_VISIBILITY_API is disabled.");
     3900    return EINA_FALSE;
     3901#endif
     3902}
     3903
     3904Ewk_Page_Visibility_State ewk_view_visibility_state_get(const Evas_Object* ewkView)
     3905{
     3906#if ENABLE(PAGE_VISIBILITY_API)
     3907    EWK_VIEW_SD_GET_OR_RETURN(ewkView, smartData, EWK_PAGE_VISIBILITY_STATE_VISIBLE);
     3908    EWK_VIEW_PRIV_GET_OR_RETURN(smartData, priv, EWK_PAGE_VISIBILITY_STATE_VISIBLE);
     3909
     3910    switch (priv->page->visibilityState()) {
     3911    case WebCore::PageVisibilityStateVisible:
     3912        return EWK_PAGE_VISIBILITY_STATE_VISIBLE;
     3913    case WebCore::PageVisibilityStateHidden:
     3914        return EWK_PAGE_VISIBILITY_STATE_HIDDEN;
     3915    case WebCore::PageVisibilityStatePrerender:
     3916        return EWK_PAGE_VISIBILITY_STATE_PRERENDER;
     3917    default:
     3918        return EWK_PAGE_VISIBILITY_STATE_VISIBLE;
     3919    }
     3920#else
     3921    DBG("PAGE_VISIBILITY_API is disabled.");
     3922    return EWK_PAGE_VISIBILITY_STATE_VISIBLE;
     3923#endif
     3924}
     3925
    38773926namespace EWKPrivate {
    38783927
  • trunk/Source/WebKit/efl/ewk/ewk_view.h

    r98908 r99155  
    22192219EAPI Eina_Bool ewk_view_protocol_handler_unset(Evas_Object* o);
    22202220
     2221/// Defines the page visibility status.
     2222enum _Ewk_Page_Visibility_State {
     2223    EWK_PAGE_VISIBILITY_STATE_VISIBLE,
     2224    EWK_PAGE_VISIBILITY_STATE_HIDDEN,
     2225    EWK_PAGE_VISIBILITY_STATE_PRERENDER
     2226};
     2227/// Creates a type name for @a _Ewk_Page_Visibility_State.
     2228typedef enum _Ewk_Page_Visibility_State Ewk_Page_Visibility_State;
     2229
     2230/**
     2231 * Sets the visibility state of the page.
     2232 *
     2233 * This function let WebKit knows the visibility status of the page.
     2234 * WebKit will save the current status, and fire a "visibilitychange"
     2235 * event which web application can listen. Web application could slow
     2236 * down or stop itself when it gets a "visibilitychange" event and its
     2237 * visibility state is hidden. If its visibility state is visible, then
     2238 * the web application could use more resources.
     2239 *
     2240 * This feature makes that web application could use the resources efficiently,
     2241 * such as power, CPU, and etc.
     2242 *
     2243 * If more detailed description is needed, please see the specification.
     2244 * (http://www.w3.org/TR/page-visibility)
     2245 *
     2246 * @param o view object to set the visibility state.
     2247 * @param page_visible_state the visible state of the page to set.
     2248 * @param initial_state @c EINA_TRUE if this function is called at page initialization time,
     2249 *                      @c EINA_FALSE otherwise.
     2250 *
     2251 * @return @c EINA_TRUE on success or @c EINA_FALSE on failure.
     2252 */
     2253EAPI Eina_Bool ewk_view_visibility_state_set(Evas_Object* o, Ewk_Page_Visibility_State page_visible_state, Eina_Bool initial_state);
     2254
     2255/**
     2256 * Gets the visibility state of the page.
     2257 *
     2258 * @param o view object
     2259 *
     2260 * @return enum value of @a Ewk_Page_Visibility_State that indicates current visibility status of the page.
     2261 *
     2262 * @see ewk_view_visibility_state_set()
     2263 */
     2264EAPI Ewk_Page_Visibility_State ewk_view_visibility_state_get(const Evas_Object *o);
     2265
    22212266#ifdef __cplusplus
    22222267}
  • trunk/Source/cmake/OptionsEfl.cmake

    r97771 r99155  
    8484WEBKIT_FEATURE(ENABLE_NOTIFICATIONS "Enable notifications" DEFAULT OFF)
    8585WEBKIT_FEATURE(ENABLE_ORIENTATION_EVENTS "Enable orientation events" DEFAULT OFF)
     86WEBKIT_FEATURE(ENABLE_PAGE_VISIBILITY_API "Enable Page Visibility API" DEFAULT ON)
    8687WEBKIT_FEATURE(ENABLE_PROGRESS_TAG "Enable progress tag" DEFAULT ON)
    8788WEBKIT_FEATURE(ENABLE_SHARED_WORKERS "Enable shared workers" DEFAULT ON)
  • trunk/Source/cmakeconfig.h.cmake

    r97771 r99155  
    3131#cmakedefine01 ENABLE_NOTIFICATIONS
    3232#cmakedefine01 ENABLE_ORIENTATION_EVENTS
     33#cmakedefine01 ENABLE_PAGE_VISIBILITY_API
    3334#cmakedefine01 ENABLE_PROGRESS_TAG
    3435#cmakedefine01 ENABLE_SHARED_WORKERS
Note: See TracChangeset for help on using the changeset viewer.