diff options
Diffstat (limited to 'Tools/WebKitTestRunner/qt/PlatformWebViewQt.cpp')
| -rw-r--r-- | Tools/WebKitTestRunner/qt/PlatformWebViewQt.cpp | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/Tools/WebKitTestRunner/qt/PlatformWebViewQt.cpp b/Tools/WebKitTestRunner/qt/PlatformWebViewQt.cpp index e1cce48a5..47d407e50 100644 --- a/Tools/WebKitTestRunner/qt/PlatformWebViewQt.cpp +++ b/Tools/WebKitTestRunner/qt/PlatformWebViewQt.cpp @@ -77,14 +77,19 @@ private: QQuickWebView* m_view; }; -PlatformWebView::PlatformWebView(WKContextRef contextRef, WKPageGroupRef pageGroupRef, WKDictionaryRef /*options*/) - : m_view(new QQuickWebView(contextRef, pageGroupRef)) - , m_window(new WrapperWindow(m_view)) - , m_windowIsKey(true) +PlatformWebView::PlatformWebView(WKContextRef contextRef, WKPageGroupRef pageGroupRef, WKDictionaryRef options) + : m_windowIsKey(true) , m_modalEventLoop(0) { + WKRetainPtr<WKStringRef> useFixedLayoutKey(AdoptWK, WKStringCreateWithUTF8CString("UseFixedLayout")); + m_usingFixedLayout = options ? WKBooleanGetValue(static_cast<WKBooleanRef>(WKDictionaryGetItemForKey(options, useFixedLayoutKey.get()))) : false; + QQuickWebViewExperimental::setFlickableViewportEnabled(m_usingFixedLayout); + + m_view = new QQuickWebView(contextRef, pageGroupRef); m_view->setAllowAnyHTTPSCertificateForLocalHost(true); m_view->componentComplete(); + + m_window = new WrapperWindow(m_view); } PlatformWebView::~PlatformWebView() @@ -172,6 +177,13 @@ bool PlatformWebView::windowShapshotEnabled() return result; } +bool PlatformWebView::viewSupportsOptions(WKDictionaryRef options) const +{ + WKRetainPtr<WKStringRef> useFixedLayoutKey(AdoptWK, WKStringCreateWithUTF8CString("UseFixedLayout")); + + return m_usingFixedLayout == (options ? WKBooleanGetValue(static_cast<WKBooleanRef>(WKDictionaryGetItemForKey(options, useFixedLayoutKey.get()))) : false); +} + } // namespace WTR #include "PlatformWebViewQt.moc" |
