Skip to content

Commit

Permalink
Merge r231917 - [WPE] Implement and enable FULLSCREEN_API
Browse files Browse the repository at this point in the history
https://bugs.webkit.org/show_bug.cgi?id=185676

Reviewed by Žan Doberšek.

.:

Remove the CMake option to disable this option for WPE.
This feature gets enabled now via Source/cmake/WebKitFeatures.cmake

* Source/cmake/OptionsWPE.cmake:

Source/WebKit:

Do the initial implementation of FULLSCREEN_API for WPE and
enable the CMake option by default.

Most of the layout tests (55 of 58) are passing and the feature
seems to work fine on different websites that use it.

* UIProcess/API/wpe/PageClientImpl.cpp:
(WebKit::PageClientImpl::fullScreenManagerProxyClient):
(WebKit::PageClientImpl::closeFullScreenManager):
(WebKit::PageClientImpl::isFullScreen):
(WebKit::PageClientImpl::enterFullScreen):
(WebKit::PageClientImpl::exitFullScreen):
(WebKit::PageClientImpl::beganEnterFullScreen):
(WebKit::PageClientImpl::beganExitFullScreen):
* UIProcess/API/wpe/PageClientImpl.h:
* UIProcess/API/wpe/WPEView.h:
(WKWPE::View::isFullScreen):
(WKWPE::View::setFullScreen):

Tools:

* TestWebKitAPI/Tests/WebKitGLib/TestWebKitWebView.cpp:
(testWebViewFullScreen):

LayoutTests:

Enable all the 58 fullscreen related tests.
Are all passing but 3.

* platform/wpe/TestExpectations:
* platform/wpe/fullscreen/full-screen-placeholder-expected.txt: Added. Copied baseline from WebKitGTK+ port.
  • Loading branch information
clopez authored and aperezdc committed May 18, 2018
1 parent 2df6c88 commit 03b9eaf
Show file tree
Hide file tree
Showing 11 changed files with 165 additions and 4 deletions.
12 changes: 12 additions & 0 deletions ChangeLog
@@ -1,3 +1,15 @@
2018-05-17 Carlos Alberto Lopez Perez <clopez@igalia.com>

[WPE] Implement and enable FULLSCREEN_API
https://bugs.webkit.org/show_bug.cgi?id=185676

Reviewed by Žan Doberšek.

Remove the CMake option to disable this option for WPE.
This feature gets enabled now via Source/cmake/WebKitFeatures.cmake

* Source/cmake/OptionsWPE.cmake:

2018-05-10 Michael Catanzaro <mcatanzaro@igalia.com>

Unreviewed. Update OptionsWPE.cmake and NEWS for 2.19.93 release.
Expand Down
13 changes: 13 additions & 0 deletions LayoutTests/ChangeLog
@@ -1,3 +1,16 @@
2018-05-17 Carlos Alberto Lopez Perez <clopez@igalia.com>

[WPE] Implement and enable FULLSCREEN_API
https://bugs.webkit.org/show_bug.cgi?id=185676

Reviewed by Žan Doberšek.

Enable all the 58 fullscreen related tests.
Are all passing but 3.

* platform/wpe/TestExpectations:
* platform/wpe/fullscreen/full-screen-placeholder-expected.txt: Added. Copied baseline from WebKitGTK+ port.

2018-04-24 Tadeu Zagallo <tzagallo@apple.com>

REGRESSION(r221839): Fix requests with FormData containing empty files
Expand Down
7 changes: 5 additions & 2 deletions LayoutTests/platform/wpe/TestExpectations
@@ -1,7 +1,6 @@
Bug(WPE) compositing/ [ Skip ]
Bug(WPE) editing/ [ Skip ]
Bug(WPE) fonts/ [ Skip ]
Bug(WPE) fullscreen/ [ Skip ]
Bug(WPE) gamepad/ [ Skip ]
Bug(WPE) inspector/ [ Skip ]
Bug(WPE) mathml/ [ Skip ]
Expand Down Expand Up @@ -1031,7 +1030,6 @@ http/tests/contentfiltering [ Skip ]
http/tests/download [ Skip ]
http/tests/fileapi [ Skip ]
http/tests/frame-throttling [ Skip ]
http/tests/fullscreen [ Skip ]
http/tests/globalhistory [ Skip ]
http/tests/history [ Skip ]
http/tests/inspector [ Skip ]
Expand Down Expand Up @@ -1173,3 +1171,8 @@ webkit.org/b/182240 svg/animations/svgenum-animation-7.html [ Pass Crash ]
webkit.org/b/182244 http/tests/appcache/fail-on-update-2.html [ Failure ]

webkit.org/b/181139 imported/w3c/web-platform-tests/WebCryptoAPI/encrypt_decrypt/test_rsa_oaep.https.html [ Pass Failure ]

# This 3 fullscreen tests are still not passing.
webkit.org/b/185676 fullscreen/requestFullscreen-escape-key.html [ Failure ]
webkit.org/b/185676 fullscreen/video-controls-rtl.html [ Failure ]
webkit.org/b/185676 fullscreen/full-screen-plugin.html [ Timeout ]
@@ -0,0 +1,17 @@
This layout test checks that the offset positions of the blue and green divs does not change when the red div enters full-screen mode. Press go full-screen to begin.
One
Two
EVENT(webkitfullscreenchange)
EXPECTED (document.webkitCurrentFullScreenElement == '[object HTMLDivElement]') OK
EXPECTED (one.offsetLeft == '68') OK
EXPECTED (one.offsetTop == '57') OK
EXPECTED (two.offsetLeft == '8') OK
EXPECTED (two.offsetTop == '117') OK
EVENT(webkitfullscreenchange)
EXPECTED (document.webkitCurrentFullScreenElement == 'null') OK
EXPECTED (one.offsetLeft == '68') OK
EXPECTED (one.offsetTop == '57') OK
EXPECTED (two.offsetLeft == '8') OK
EXPECTED (two.offsetTop == '117') OK
END OF TEST

26 changes: 26 additions & 0 deletions Source/WebKit/ChangeLog
@@ -1,3 +1,29 @@
2018-05-17 Carlos Alberto Lopez Perez <clopez@igalia.com>

[WPE] Implement and enable FULLSCREEN_API
https://bugs.webkit.org/show_bug.cgi?id=185676

Reviewed by Žan Doberšek.

Do the initial implementation of FULLSCREEN_API for WPE and
enable the CMake option by default.

Most of the layout tests (55 of 58) are passing and the feature
seems to work fine on different websites that use it.

* UIProcess/API/wpe/PageClientImpl.cpp:
(WebKit::PageClientImpl::fullScreenManagerProxyClient):
(WebKit::PageClientImpl::closeFullScreenManager):
(WebKit::PageClientImpl::isFullScreen):
(WebKit::PageClientImpl::enterFullScreen):
(WebKit::PageClientImpl::exitFullScreen):
(WebKit::PageClientImpl::beganEnterFullScreen):
(WebKit::PageClientImpl::beganExitFullScreen):
* UIProcess/API/wpe/PageClientImpl.h:
* UIProcess/API/wpe/WPEView.h:
(WKWPE::View::isFullScreen):
(WKWPE::View::setFullScreen):

2018-05-10 Michael Catanzaro <mcatanzaro@igalia.com>

Unreviewed. Update OptionsWPE.cmake and NEWS for 2.19.93 release.
Expand Down
54 changes: 54 additions & 0 deletions Source/WebKit/UIProcess/API/wpe/PageClientImpl.cpp
Expand Up @@ -326,4 +326,58 @@ JSGlobalContextRef PageClientImpl::javascriptGlobalContext()
return m_view.javascriptGlobalContext();
}

#if ENABLE(FULLSCREEN_API)
WebFullScreenManagerProxyClient& PageClientImpl::fullScreenManagerProxyClient()
{
return *this;
}

void PageClientImpl::closeFullScreenManager()
{
notImplemented();
}

bool PageClientImpl::isFullScreen()
{
return m_view.isFullScreen();
}

void PageClientImpl::enterFullScreen()
{
if (isFullScreen())
return;

WebFullScreenManagerProxy* fullScreenManagerProxy = m_view.page().fullScreenManager();
if (fullScreenManagerProxy) {
fullScreenManagerProxy->willEnterFullScreen();
m_view.setFullScreen(true);
fullScreenManagerProxy->didEnterFullScreen();
}
}

void PageClientImpl::exitFullScreen()
{
if (!isFullScreen())
return;

WebFullScreenManagerProxy* fullScreenManagerProxy = m_view.page().fullScreenManager();
if (fullScreenManagerProxy) {
fullScreenManagerProxy->willExitFullScreen();
m_view.setFullScreen(false);
fullScreenManagerProxy->didExitFullScreen();
}
}

void PageClientImpl::beganEnterFullScreen(const WebCore::IntRect& /* initialFrame */, const WebCore::IntRect& /* finalFrame */)
{
notImplemented();
}

void PageClientImpl::beganExitFullScreen(const WebCore::IntRect& /* initialFrame */, const WebCore::IntRect& /* finalFrame */)
{
notImplemented();
}

#endif // ENABLE(FULLSCREEN_API)

} // namespace WebKit
18 changes: 17 additions & 1 deletion Source/WebKit/UIProcess/API/wpe/PageClientImpl.h
Expand Up @@ -26,6 +26,7 @@
#pragma once

#include "PageClient.h"
#include "WebFullScreenManagerProxy.h"

namespace WKWPE {
class View;
Expand All @@ -35,7 +36,11 @@ namespace WebKit {

class ScrollGestureController;

class PageClientImpl final : public PageClient {
class PageClientImpl final : public PageClient
#if ENABLE(FULLSCREEN_API)
, public WebFullScreenManagerProxyClient
#endif
{
public:
PageClientImpl(WKWPE::View&);
virtual ~PageClientImpl();
Expand Down Expand Up @@ -117,6 +122,17 @@ class PageClientImpl final : public PageClient {

void didRestoreScrollPosition() override;

#if ENABLE(FULLSCREEN_API)
WebFullScreenManagerProxyClient& fullScreenManagerProxyClient() final;

void closeFullScreenManager() override;
bool isFullScreen() override;
void enterFullScreen() override;
void exitFullScreen() override;
void beganEnterFullScreen(const WebCore::IntRect& initialFrame, const WebCore::IntRect& finalFrame) override;
void beganExitFullScreen(const WebCore::IntRect& initialFrame, const WebCore::IntRect& finalFrame) override;
#endif

WebCore::UserInterfaceLayoutDirection userInterfaceLayoutDirection() override;

JSGlobalContextRef javascriptGlobalContext() override;
Expand Down
9 changes: 9 additions & 0 deletions Source/WebKit/UIProcess/API/wpe/WPEView.h
Expand Up @@ -73,6 +73,11 @@ class View : public API::ObjectImpl<API::Object::Type::View> {

void close();

#if ENABLE(FULLSCREEN_API)
bool isFullScreen() { return m_fullScreenModeActive; };
void setFullScreen(bool fullScreenState) { m_fullScreenModeActive = fullScreenState; };
#endif

private:
View(struct wpe_view_backend*, const API::PageConfiguration&);

Expand All @@ -87,6 +92,10 @@ class View : public API::ObjectImpl<API::Object::Type::View> {

WebKit::CompositingManagerProxy m_compositingManagerProxy;
struct wpe_view_backend* m_backend;

#if ENABLE(FULLSCREEN_API)
bool m_fullScreenModeActive { false };
#endif
};

} // namespace WKWPE
1 change: 0 additions & 1 deletion Source/cmake/OptionsWPE.cmake
Expand Up @@ -30,7 +30,6 @@ WEBKIT_OPTION_DEFAULT_PORT_VALUE(USE_SYSTEM_MALLOC PUBLIC OFF)
# Private options shared with other WebKit ports. Add options here only if
# we need a value different from the default defined in WebKitFeatures.cmake.
# Changing these options is completely unsupported.
WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_FULLSCREEN_API PRIVATE OFF)
WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_GEOLOCATION PRIVATE OFF)
WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_MHTML PRIVATE ON)
WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_NETSCAPE_PLUGIN_API PRIVATE OFF)
Expand Down
10 changes: 10 additions & 0 deletions Tools/ChangeLog
@@ -1,3 +1,13 @@
2018-05-17 Carlos Alberto Lopez Perez <clopez@igalia.com>

[WPE] Implement and enable FULLSCREEN_API
https://bugs.webkit.org/show_bug.cgi?id=185676

Reviewed by Žan Doberšek.

* TestWebKitAPI/Tests/WebKitGLib/TestWebKitWebView.cpp:
(testWebViewFullScreen):

2018-05-10 Michael Catanzaro <mcatanzaro@igalia.com>

Fix some -Wstring-op-truncation warnings
Expand Down
2 changes: 2 additions & 0 deletions Tools/TestWebKitAPI/Tests/WebKitGLib/TestWebKitWebView.cpp
Expand Up @@ -433,7 +433,9 @@ class FullScreenClientTest: public WebViewTest {
#if ENABLE(FULLSCREEN_API)
static void testWebViewFullScreen(FullScreenClientTest* test, gconstpointer)
{
#if PLATFORM(GTK)
test->showInWindowAndWaitUntilMapped();
#endif
test->loadHtml("<html><body>FullScreen test</body></html>", 0);
test->waitUntilLoadFinished();
test->requestFullScreenAndWaitUntilEnteredFullScreen();
Expand Down

0 comments on commit 03b9eaf

Please sign in to comment.