[Webkit-unassigned] [Bug 109422] [Qt] Add Page Visibility API support

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Aug 5 08:36:52 PDT 2013


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


Jocelyn Turcotte <jocelyn.turcotte at digia.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
 Attachment #208125|review?                     |review-
               Flag|                            |




--- Comment #59 from Jocelyn Turcotte <jocelyn.turcotte at digia.com>  2013-08-05 08:36:33 PST ---
(From update of attachment 208125)
View in context: https://bugs.webkit.org/attachment.cgi?id=208125&action=review

> Source/WebKit/qt/ChangeLog:3
> +        [Qt] Add Page Visibility API support

Ideally this patch should also enable PAGE_VISIBILITY_API by default in the build, but this can also be done in a separate patch as long as you do it soon.

> Source/WebKit/qt/WebCoreSupport/QWebPageAdapter.cpp:159
> +        result = WebCore::PageVisibilityStatePrerender;
> +        break;

you can replace the temporary result variable by "return WebCore::PageVisibilityStatePrerender;" directly and also remove the breaks and the final return.

> Source/WebKit/qt/WebCoreSupport/QWebPageAdapter.cpp:247
> +    page->setVisibilityState(webPageVisibilityStateToWebCoreVisibilityState(m_visibilityState), true);

Page::m_visibilityState is already initialized to PageVisibilityStateVisible, I'm not sure I see a use for this.

> Source/WebKit/qt/WebCoreSupport/QWebPageAdapter.cpp:339
> +    if (!page)
> +        return;

By looking at the rest of the code I'd say that you can expect page to be non-null here, am I right?

> Source/WebKit/qt/WebCoreSupport/QWebPageAdapter.cpp:349
> +    return m_visibilityState;

Why not use WebCore::Page::visibilityState() directly instead?

> Source/WebKit/qt/WebCoreSupport/QWebPageAdapter.h:136
> +    // Must match with values of PageVisibilityState enum from PageVisibilityState.h.

It's not true anymore, it must however match QWebPage::PageVisibilityState.

> Source/WebKit/qt/WidgetApi/qwebpage.cpp:3142
> +    Returns the current page visibility state of the current page.

"of the current page" is unneeded extra information. I think it's obvious.

> Source/WebKit/qt/WidgetApi/qwebpage.cpp:3152
> +    This method is used to change the page visibility state of the current page.

ditto

> Source/WebKit/qt/WidgetApi/qwebpage.cpp:3153
> +    It should be called by Qt applications who want to notify Javascript application

grammar: "JavaScript applications" or "the JavaScript application"

> Source/WebKit/qt/WidgetApi/qwebpage.cpp:3154
> +    that the visibility state has changed (eg. by reimplementing setVisible function of QWidget).

- eg. --> e.g.
- "the setVisible function" or simply "QWidget::setVisible" (the later should also add a link automatically in the doc)

The rest of the method documentaion is pretty good and descriptive :)

> Source/WebKit/qt/WidgetApi/qwebpage.h:220
> +    enum PageVisibilityState {

VisibilityState would be fine and match with the property name. "Page" isn't helpful here.

-- 
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