summaryrefslogtreecommitdiffstats
path: root/Source/WebKit
diff options
context:
space:
mode:
authorKonstantin Tokarev <annulen@yandex.ru>2017-03-30 15:27:58 +0300
committerKonstantin Tokarev <annulen@yandex.ru>2017-03-31 10:31:00 +0000
commitbe770ca621f6463339b7d15be088e1b9acd851e5 (patch)
tree1a843019f693c100adea3f3acd47999f3eba2796 /Source/WebKit
parenteaaf1391d58f17bde794d6c8634e092209898941 (diff)
Import WebKit commit 13ac532967b6ac2d18d6fc4ea72c4ca35eccff20
Change-Id: I12a5c8f98aeaac1b542ce20c0ff297c57b5d84d1 Reviewed-by: Konstantin Tokarev <annulen@yandex.ru>
Diffstat (limited to 'Source/WebKit')
-rw-r--r--Source/WebKit/CMakeLists.txt23
-rw-r--r--Source/WebKit/PlatformQt.cmake3
-rw-r--r--Source/WebKit/qt/Api/qwebsettings.cpp6
-rw-r--r--Source/WebKit/qt/WebCoreSupport/ChromeClientQt.cpp10
-rw-r--r--Source/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp6
-rw-r--r--Source/WebKit/qt/WebCoreSupport/InspectorClientQt.cpp4
-rw-r--r--Source/WebKit/qt/WebCoreSupport/InspectorServerQt.cpp2
-rw-r--r--Source/WebKit/qt/WebCoreSupport/QWebFrameAdapter.cpp18
-rw-r--r--Source/WebKit/qt/WebCoreSupport/QWebPageAdapter.cpp26
-rw-r--r--Source/WebKit/qt/WebCoreSupport/QWebPageAdapter.h2
-rw-r--r--Source/WebKit/qt/WebCoreSupport/TextureMapperLayerClientQt.cpp14
-rw-r--r--Source/WebKit/qt/WebCoreSupport/TextureMapperLayerClientQt.h12
-rw-r--r--Source/WebKit/qt/WidgetApi/qgraphicswebview.cpp4
-rw-r--r--Source/WebKit/qt/WidgetApi/qwebpage.cpp71
-rw-r--r--Source/WebKit/qt/WidgetApi/qwebpage_p.h2
15 files changed, 138 insertions, 65 deletions
diff --git a/Source/WebKit/CMakeLists.txt b/Source/WebKit/CMakeLists.txt
index 081858daa..aff418d6d 100644
--- a/Source/WebKit/CMakeLists.txt
+++ b/Source/WebKit/CMakeLists.txt
@@ -54,17 +54,22 @@ set(WebKit_PRIVATE_HEADERS_LOCATION Headers/${PROJECT_VERSION}/QtWebKit/Private)
WEBKIT_FRAMEWORK(WebKit)
-set_target_properties(WebKit PROPERTIES VERSION ${PROJECT_VERSION} SOVERSION ${PROJECT_VERSION_MAJOR})
-install(TARGETS WebKit EXPORT WebKitTargets
- DESTINATION "${LIB_INSTALL_DIR}"
- RUNTIME DESTINATION "${BIN_INSTALL_DIR}"
-)
+if (${PORT} STREQUAL "Qt")
+ set_target_properties(WebKit PROPERTIES VERSION ${PROJECT_VERSION} SOVERSION ${PROJECT_VERSION_MAJOR})
+ install(TARGETS WebKit EXPORT WebKitTargets
+ DESTINATION "${LIB_INSTALL_DIR}"
+ RUNTIME DESTINATION "${BIN_INSTALL_DIR}"
+ )
+ if (MSVC)
+ install(FILES $<TARGET_PDB_FILE:WebKit> DESTINATION "${BIN_INSTALL_DIR}" OPTIONAL)
+ endif ()
+
+ if (NOT MSVC)
+ ADD_PREFIX_HEADER(WebKit "${WEBKIT_DIR}/qt/WebKitPrefix.h")
+ endif ()
+endif ()
add_dependencies(WebKit WebCore)
if (TARGET WebKitGUID)
add_dependencies(WebKit WebKitGUID)
endif ()
-
-if (NOT MSVC AND ${PORT} STREQUAL "Qt")
- ADD_PREFIX_HEADER(WebKit "${WEBKIT_DIR}/qt/WebKitPrefix.h")
-endif ()
diff --git a/Source/WebKit/PlatformQt.cmake b/Source/WebKit/PlatformQt.cmake
index 7e319fade..82fc4595a 100644
--- a/Source/WebKit/PlatformQt.cmake
+++ b/Source/WebKit/PlatformQt.cmake
@@ -680,6 +680,9 @@ install(TARGETS WebKitWidgets EXPORT Qt5WebKitWidgetsTargets
DESTINATION "${LIB_INSTALL_DIR}"
RUNTIME DESTINATION "${BIN_INSTALL_DIR}"
)
+if (MSVC)
+ install(FILES $<TARGET_PDB_FILE:WebKitWidgets> DESTINATION "${BIN_INSTALL_DIR}" OPTIONAL)
+endif ()
if (NOT MSVC AND WIN32)
ADD_PREFIX_HEADER(WebKitWidgets "qt/WebKitWidgetsPrefix.h")
diff --git a/Source/WebKit/qt/Api/qwebsettings.cpp b/Source/WebKit/qt/Api/qwebsettings.cpp
index ddb8f75fe..4bc481126 100644
--- a/Source/WebKit/qt/Api/qwebsettings.cpp
+++ b/Source/WebKit/qt/Api/qwebsettings.cpp
@@ -525,6 +525,8 @@ QWebSettings* QWebSettings::globalSettings()
This is disabled by default.
\value SiteSpecificQuirksEnabled This setting enables WebKit's workaround for broken sites. It is
enabled by default.
+ \value CSSRegionsEnabled This setting enables support for the CSS 3 Regions module. This
+ CSS module is currently only a draft and support for it is enabled by default.
\value ScrollAnimatorEnabled This setting enables animated scrolling. It is disabled by default.
\value CaretBrowsingEnabled This setting enables caret browsing. It is disabled by default.
\value NotificationsEnabled Specifies whether support for the HTML 5 web notifications is enabled
@@ -536,6 +538,10 @@ QWebSettings* QWebSettings::globalSettings()
strongly discouraged as it makes the browser more prone to malicious code. This setting is intended
primarily for site-specific browsers (i.e. when the user can't navigate to unsecure web page) and for testing
web applications before deployment.
+ \value WebGLEnabled This setting enables support for WebGL.
+ It is enabled by default.
+ \value HyperlinkAuditingEnabled This setting enables support for hyperlink auditing (<a ping>).
+ It is disabled by default.
*/
/*!
diff --git a/Source/WebKit/qt/WebCoreSupport/ChromeClientQt.cpp b/Source/WebKit/qt/WebCoreSupport/ChromeClientQt.cpp
index 1c6504993..37e66a0ef 100644
--- a/Source/WebKit/qt/WebCoreSupport/ChromeClientQt.cpp
+++ b/Source/WebKit/qt/WebCoreSupport/ChromeClientQt.cpp
@@ -416,7 +416,7 @@ void ChromeClientQt::invalidateRootView(const IntRect& windowRect)
{
#if USE(TILED_BACKING_STORE)
if (platformPageClient()) {
- WebCore::TiledBackingStore* backingStore = m_webPage->mainFrameAdapter()->frame->tiledBackingStore();
+ WebCore::TiledBackingStore* backingStore = m_webPage->mainFrameAdapter().frame->tiledBackingStore();
if (!backingStore)
return;
backingStore->invalidate(windowRect);
@@ -457,7 +457,7 @@ void ChromeClientQt::scroll(const IntSize& delta, const IntRect& scrollViewRect,
void ChromeClientQt::delegatedScrollRequested(const IntPoint& point)
{
- const QPoint ofs = m_webPage->mainFrameAdapter()->scrollPosition();
+ const QPoint ofs = m_webPage->mainFrameAdapter().scrollPosition();
IntSize currentPosition(ofs.x(), ofs.y());
int x = point.x() - currentPosition.width();
int y = point.y() - currentPosition.height();
@@ -620,7 +620,7 @@ void ChromeClientQt::scheduleAnimation()
void ChromeClientQt::serviceScriptedAnimations()
{
- m_webPage->mainFrameAdapter()->frame->view()->serviceScriptedAnimations(currentTime());
+ m_webPage->mainFrameAdapter().frame->view()->serviceScriptedAnimations(currentTime());
}
#endif
@@ -660,9 +660,9 @@ IntRect ChromeClientQt::visibleRectForTiledBackingStore() const
return IntRect();
if (!platformPageClient()->viewResizesToContentsEnabled()) {
- const QPoint ofs = m_webPage->mainFrameAdapter()->scrollPosition();
+ const QPoint ofs = m_webPage->mainFrameAdapter().scrollPosition();
IntSize offset(ofs.x(), ofs.y());
- return QRect(QPoint(offset.width(), offset.height()), m_webPage->mainFrameAdapter()->frameRect().size());
+ return QRect(QPoint(offset.width(), offset.height()), m_webPage->mainFrameAdapter().frameRect().size());
}
return enclosingIntRect(FloatRect(platformPageClient()->graphicsItemVisibleRect()));
diff --git a/Source/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp b/Source/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp
index b45fb6b2a..76038cbc0 100644
--- a/Source/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp
+++ b/Source/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp
@@ -102,7 +102,7 @@ static QString drtDescriptionSuitableForTestResult(WebCore::Frame* webCoreFrame)
QWebFrameAdapter* frame = QWebFrameAdapter::kit(webCoreFrame);
QString name = webCoreFrame->tree().uniqueName();
- bool isMainFrame = frame == frame->pageAdapter->mainFrameAdapter();
+ bool isMainFrame = frame == &frame->pageAdapter->mainFrameAdapter();
if (isMainFrame) {
if (!name.isEmpty())
return QString::fromLatin1("main frame \"%1\"").arg(name);
@@ -986,7 +986,7 @@ void FrameLoaderClientQt::dispatchWillSendRequest(WebCore::DocumentLoader*, unsi
&& !host.isEmpty()
&& (urlScheme == QLatin1String("http") || urlScheme == QLatin1String("https"))) {
- QUrl testURL = m_webFrame->pageAdapter->mainFrameAdapter()->frameLoaderClient->lastRequestedUrl();
+ QUrl testURL = m_webFrame->pageAdapter->mainFrameAdapter().frameLoaderClient->lastRequestedUrl();
QString testHost = testURL.host();
QString testURLScheme = testURL.scheme().toLower();
@@ -1136,7 +1136,7 @@ WebCore::Frame* FrameLoaderClientQt::dispatchCreatePage(const WebCore::Navigatio
QWebPageAdapter* newPage = m_webFrame->pageAdapter->createWindow(/* modalDialog = */ false);
if (!newPage)
return 0;
- return newPage->mainFrameAdapter()->frame;
+ return newPage->mainFrameAdapter().frame;
}
void FrameLoaderClientQt::dispatchDecidePolicyForResponse(const WebCore::ResourceResponse& response, const WebCore::ResourceRequest&, FramePolicyFunction function)
diff --git a/Source/WebKit/qt/WebCoreSupport/InspectorClientQt.cpp b/Source/WebKit/qt/WebCoreSupport/InspectorClientQt.cpp
index 29879a08a..aaa248667 100644
--- a/Source/WebKit/qt/WebCoreSupport/InspectorClientQt.cpp
+++ b/Source/WebKit/qt/WebCoreSupport/InspectorClientQt.cpp
@@ -195,7 +195,7 @@ Inspector::FrontendChannel* InspectorClientQt::openLocalFrontend(WebCore::Inspec
m_frontendWebPage->page->setGroupName("__WebInspectorPageGroup__");
frontendChannel = this;
- inspectorPage->mainFrameAdapter()->load(QNetworkRequest(inspectorUrl));
+ inspectorPage->mainFrameAdapter().load(QNetworkRequest(inspectorUrl));
m_inspectedWebPage->setInspectorFrontend(view);
return frontendChannel;
@@ -238,7 +238,7 @@ void InspectorClientQt::highlight()
void InspectorClientQt::hideHighlight()
{
WebCore::Frame& frame = m_inspectedWebPage->page->mainFrame();
- QRect rect = m_inspectedWebPage->mainFrameAdapter()->frameRect();
+ QRect rect = m_inspectedWebPage->mainFrameAdapter().frameRect();
if (!rect.isEmpty())
frame.view()->invalidateRect(rect);
}
diff --git a/Source/WebKit/qt/WebCoreSupport/InspectorServerQt.cpp b/Source/WebKit/qt/WebCoreSupport/InspectorServerQt.cpp
index 45df842a5..bd9fee1f2 100644
--- a/Source/WebKit/qt/WebCoreSupport/InspectorServerQt.cpp
+++ b/Source/WebKit/qt/WebCoreSupport/InspectorServerQt.cpp
@@ -227,7 +227,7 @@ void InspectorServerRequestHandlerQt::tcpReadyRead()
indexHtml.append(QString::fromLatin1("<li><a href=\"/webkit/inspector/UserInterface/Main.html?page=%1\">%2</li>\n")
.arg(it.key())
- .arg(QUrl(it.value()->m_inspectedWebPage->mainFrameAdapter()->url).toString()));
+ .arg(QUrl(it.value()->m_inspectedWebPage->mainFrameAdapter().url).toString()));
}
indexHtml.append(QLatin1String("</ul></body></html>"));
response = indexHtml.toLatin1();
diff --git a/Source/WebKit/qt/WebCoreSupport/QWebFrameAdapter.cpp b/Source/WebKit/qt/WebCoreSupport/QWebFrameAdapter.cpp
index de90866c6..e6145b6ff 100644
--- a/Source/WebKit/qt/WebCoreSupport/QWebFrameAdapter.cpp
+++ b/Source/WebKit/qt/WebCoreSupport/QWebFrameAdapter.cpp
@@ -465,7 +465,7 @@ QString QWebFrameAdapter::uniqueName() const
// This code is copied from ChromeClientGtk.cpp.
static void coalesceRectsIfPossible(const QRect& clipRect, QVector<QRect>& rects)
{
- const unsigned rectThreshold = 10;
+ const int rectThreshold = 10;
const float wastedSpaceThreshold = 0.75f;
bool useUnionedRect = (rects.size() <= 1) || (rects.size() > rectThreshold);
if (!useUnionedRect) {
@@ -474,8 +474,8 @@ static void coalesceRectsIfPossible(const QRect& clipRect, QVector<QRect>& rects
// is too large, then we will do individual rect painting instead.
float unionPixels = (clipRect.width() * clipRect.height());
float singlePixels = 0;
- for (size_t i = 0; i < rects.size(); ++i)
- singlePixels += rects[i].width() * rects[i].height();
+ for (auto& rect : rects)
+ singlePixels += rect.width() * rect.height();
float wastedSpace = 1 - (singlePixels / unionPixels);
if (wastedSpace <= wastedSpaceThreshold)
useUnionedRect = true;
@@ -924,7 +924,7 @@ QWebElement QWebHitTestResultPrivate::elementForInnerNode() const
QSize QWebFrameAdapter::customLayoutSize() const
{
- ASSERT(pageAdapter->mainFrameAdapter() == this);
+ ASSERT(&pageAdapter->mainFrameAdapter() == this);
FrameView* view = frame->view();
ASSERT(view);
if (view->useFixedLayout())
@@ -934,7 +934,7 @@ QSize QWebFrameAdapter::customLayoutSize() const
void QWebFrameAdapter::setCustomLayoutSize(const QSize& size)
{
- ASSERT(pageAdapter->mainFrameAdapter() == this);
+ ASSERT(&pageAdapter->mainFrameAdapter() == this);
FrameView* view = frame->view();
ASSERT(view);
@@ -949,7 +949,7 @@ void QWebFrameAdapter::setCustomLayoutSize(const QSize& size)
void QWebFrameAdapter::setFixedVisibleContentRect(const QRect& rect)
{
- ASSERT(pageAdapter->mainFrameAdapter() == this);
+ ASSERT(&pageAdapter->mainFrameAdapter() == this);
FrameView* view = frame->view();
ASSERT(view);
view->setFixedVisibleContentRect(rect);
@@ -957,7 +957,7 @@ void QWebFrameAdapter::setFixedVisibleContentRect(const QRect& rect)
void QWebFrameAdapter::setViewportSize(const QSize& size)
{
- ASSERT(pageAdapter->mainFrameAdapter() == this);
+ ASSERT(&pageAdapter->mainFrameAdapter() == this);
FrameView* view = frame->view();
ASSERT(view);
view->resize(size);
@@ -967,14 +967,14 @@ void QWebFrameAdapter::setViewportSize(const QSize& size)
void QWebFrameAdapter::setPaintsEntireContents(bool resizesToContents)
{
- ASSERT(pageAdapter->mainFrameAdapter() == this);
+ ASSERT(&pageAdapter->mainFrameAdapter() == this);
ASSERT(frame->view());
frame->view()->setPaintsEntireContents(resizesToContents);
}
void QWebFrameAdapter::setDelegatesScrolling(bool resizesToContents)
{
- ASSERT(pageAdapter->mainFrameAdapter() == this);
+ ASSERT(&pageAdapter->mainFrameAdapter() == this);
ASSERT(frame->view());
frame->view()->setDelegatesScrolling(resizesToContents);
}
diff --git a/Source/WebKit/qt/WebCoreSupport/QWebPageAdapter.cpp b/Source/WebKit/qt/WebCoreSupport/QWebPageAdapter.cpp
index 4d2b30d37..a6d0267af 100644
--- a/Source/WebKit/qt/WebCoreSupport/QWebPageAdapter.cpp
+++ b/Source/WebKit/qt/WebCoreSupport/QWebPageAdapter.cpp
@@ -311,7 +311,7 @@ QWebPageAdapter::~QWebPageAdapter()
void QWebPageAdapter::deletePage()
{
// Before we delete the page, detach the mainframe's loader
- FrameLoader& loader = mainFrameAdapter()->frame->loader();
+ FrameLoader& loader = mainFrameAdapter().frame->loader();
loader.detachFromParent();
delete page;
page = 0;
@@ -399,7 +399,7 @@ void QWebPageAdapter::setContentEditable(bool editable)
page->setEditable(editable);
page->setTabKeyCyclesThroughElements(!editable);
- Frame* frame = mainFrameAdapter()->frame;
+ Frame* frame = mainFrameAdapter().frame;
if (editable) {
frame->editor().applyEditingStyleToBodyElement();
// FIXME: mac port calls this if there is no selectedDOMRange
@@ -488,7 +488,7 @@ void QWebPageAdapter::adjustPointForClicking(QMouseEvent* ev)
void QWebPageAdapter::mouseMoveEvent(QMouseEvent* ev)
{
- WebCore::Frame* frame = mainFrameAdapter()->frame;
+ WebCore::Frame* frame = mainFrameAdapter().frame;
if (!frame->view())
return;
if (ev->buttons() == Qt::NoButton)
@@ -500,7 +500,7 @@ void QWebPageAdapter::mouseMoveEvent(QMouseEvent* ev)
void QWebPageAdapter::mousePressEvent(QMouseEvent* ev)
{
- WebCore::Frame* frame = mainFrameAdapter()->frame;
+ WebCore::Frame* frame = mainFrameAdapter().frame;
if (!frame->view())
return;
@@ -533,7 +533,7 @@ void QWebPageAdapter::mousePressEvent(QMouseEvent* ev)
void QWebPageAdapter::mouseDoubleClickEvent(QMouseEvent *ev)
{
- WebCore::Frame* frame = mainFrameAdapter()->frame;
+ WebCore::Frame* frame = mainFrameAdapter().frame;
if (!frame->view())
return;
@@ -550,7 +550,7 @@ void QWebPageAdapter::mouseDoubleClickEvent(QMouseEvent *ev)
void QWebPageAdapter::mouseTripleClickEvent(QMouseEvent *ev)
{
- WebCore::Frame* frame = mainFrameAdapter()->frame;
+ WebCore::Frame* frame = mainFrameAdapter().frame;
if (!frame->view())
return;
@@ -564,7 +564,7 @@ void QWebPageAdapter::mouseTripleClickEvent(QMouseEvent *ev)
void QWebPageAdapter::mouseReleaseEvent(QMouseEvent *ev)
{
- WebCore::Frame* frame = mainFrameAdapter()->frame;
+ WebCore::Frame* frame = mainFrameAdapter().frame;
if (!frame->view())
return;
@@ -605,7 +605,7 @@ void QWebPageAdapter::handleSoftwareInputPanel(Qt::MouseButton button, const QPo
#ifndef QT_NO_WHEELEVENT
void QWebPageAdapter::wheelEvent(QWheelEvent *ev, int wheelScrollLines)
{
- WebCore::Frame* frame = mainFrameAdapter()->frame;
+ WebCore::Frame* frame = mainFrameAdapter().frame;
if (!frame->view())
return;
@@ -1027,7 +1027,7 @@ void QWebPageAdapter::didCloseInspector()
void QWebPageAdapter::updateActionInternal(QWebPageAdapter::MenuAction action, const char* commandName, bool* enabled, bool* checked)
{
- WebCore::FrameLoader& loader = mainFrameAdapter()->frame->loader();
+ WebCore::FrameLoader& loader = mainFrameAdapter().frame->loader();
WebCore::Editor& editor = page->focusController().focusedOrMainFrame().editor();
switch (action) {
@@ -1135,11 +1135,11 @@ void QWebPageAdapter::triggerAction(QWebPageAdapter::MenuAction action, QWebHitT
page->backForward().goForward();
break;
case Stop:
- mainFrameAdapter()->frame->loader().stopForUserCancel();
+ mainFrameAdapter().frame->loader().stopForUserCancel();
updateNavigationActions();
break;
case Reload:
- mainFrameAdapter()->frame->loader().reload(endToEndReload);
+ mainFrameAdapter().frame->loader().reload(endToEndReload);
break;
case SetTextDirectionDefault:
@@ -1454,7 +1454,7 @@ void QWebPageAdapter::focusInEvent(QFocusEvent *)
focusController.setActive(true);
focusController.setFocused(true);
if (!focusController.focusedFrame())
- focusController.setFocusedFrame(mainFrameAdapter()->frame);
+ focusController.setFocusedFrame(mainFrameAdapter().frame);
}
void QWebPageAdapter::focusOutEvent(QFocusEvent *)
@@ -1504,7 +1504,7 @@ bool QWebPageAdapter::handleShortcutOverrideEvent(QKeyEvent* event)
bool QWebPageAdapter::touchEvent(QTouchEvent* event)
{
#if ENABLE(TOUCH_EVENTS)
- Frame* frame = mainFrameAdapter()->frame;
+ Frame* frame = mainFrameAdapter().frame;
if (!frame->view() || !frame->document())
return false;
diff --git a/Source/WebKit/qt/WebCoreSupport/QWebPageAdapter.h b/Source/WebKit/qt/WebCoreSupport/QWebPageAdapter.h
index 7174d0d96..5e46fcdd7 100644
--- a/Source/WebKit/qt/WebCoreSupport/QWebPageAdapter.h
+++ b/Source/WebKit/qt/WebCoreSupport/QWebPageAdapter.h
@@ -230,7 +230,7 @@ public:
virtual void updateNavigationActions() = 0;
virtual void clearCustomActions() = 0;
- virtual QWebFrameAdapter* mainFrameAdapter() = 0;
+ virtual QWebFrameAdapter& mainFrameAdapter() = 0;
virtual QObject* inspectorHandle() = 0;
virtual void setInspectorFrontend(QObject*) = 0;
diff --git a/Source/WebKit/qt/WebCoreSupport/TextureMapperLayerClientQt.cpp b/Source/WebKit/qt/WebCoreSupport/TextureMapperLayerClientQt.cpp
index 552fe6555..85bf84c1b 100644
--- a/Source/WebKit/qt/WebCoreSupport/TextureMapperLayerClientQt.cpp
+++ b/Source/WebKit/qt/WebCoreSupport/TextureMapperLayerClientQt.cpp
@@ -31,7 +31,7 @@
using namespace WebCore;
-TextureMapperLayerClientQt::TextureMapperLayerClientQt(QWebFrameAdapter* frame)
+TextureMapperLayerClientQt::TextureMapperLayerClientQt(QWebFrameAdapter& frame)
: m_frame(frame)
, m_syncTimer(*this, &TextureMapperLayerClientQt::syncLayers)
, m_rootTextureMapperLayer(0)
@@ -71,7 +71,7 @@ void TextureMapperLayerClientQt::setRootGraphicsLayer(GraphicsLayer* layer)
m_rootGraphicsLayer->setMasksToBounds(false);
m_rootGraphicsLayer->setSize(IntSize(1, 1));
TextureMapper::AccelerationMode mode = TextureMapper::SoftwareMode;
- if (m_frame->pageAdapter->client->makeOpenGLContextCurrentIfAvailable())
+ if (pageClient() && pageClient()->makeOpenGLContextCurrentIfAvailable())
mode = TextureMapper::OpenGLMode;
m_textureMapper = TextureMapper::create(mode);
m_rootTextureMapperLayer->setTextureMapper(m_textureMapper.get());
@@ -87,7 +87,7 @@ void TextureMapperLayerClientQt::syncLayers()
if (m_rootGraphicsLayer)
syncRootLayer();
- bool didSync = m_frame->frame->view()->flushCompositingStateIncludingSubframes();
+ bool didSync = m_frame.frame->view()->flushCompositingStateIncludingSubframes();
if (!m_rootGraphicsLayer)
return;
@@ -98,7 +98,8 @@ void TextureMapperLayerClientQt::syncLayers()
if (rootLayer()->descendantsOrSelfHaveRunningAnimations() && !m_syncTimer.isActive())
m_syncTimer.startOneShot(1.0 / 60.0);
- m_frame->pageAdapter->client->repaintViewport();
+ if (pageClient())
+ pageClient()->repaintViewport();
}
void TextureMapperLayerClientQt::renderCompositedLayers(GraphicsContext& context, const IntRect& clip)
@@ -145,3 +146,8 @@ void TextureMapperLayerClientQt::renderCompositedLayers(GraphicsContext& context
m_textureMapper->endClip();
m_textureMapper->endPainting();
}
+
+QWebPageClient* TextureMapperLayerClientQt::pageClient() const
+{
+ return m_frame.pageAdapter->client.data();
+}
diff --git a/Source/WebKit/qt/WebCoreSupport/TextureMapperLayerClientQt.h b/Source/WebKit/qt/WebCoreSupport/TextureMapperLayerClientQt.h
index f34a1b2ce..b4e810879 100644
--- a/Source/WebKit/qt/WebCoreSupport/TextureMapperLayerClientQt.h
+++ b/Source/WebKit/qt/WebCoreSupport/TextureMapperLayerClientQt.h
@@ -21,20 +21,21 @@
#ifndef TextureMapperLayerClientQt_h
#define TextureMapperLayerClientQt_h
-class QWebFrameAdapter;
-
#include "GraphicsLayer.h"
#include "TextureMapper.h"
#include "TextureMapperFPSCounter.h"
#include "Timer.h"
+class QWebFrameAdapter;
+class QWebPageClient;
+
namespace WebCore {
class TextureMapperLayer;
class TextureMapperLayerClientQt final : public GraphicsLayerClient {
public:
- TextureMapperLayerClientQt(QWebFrameAdapter*);
+ TextureMapperLayerClientQt(QWebFrameAdapter&);
~TextureMapperLayerClientQt();
void syncRootLayer();
TextureMapperLayer* rootLayer();
@@ -46,8 +47,11 @@ public:
void syncLayers();
void renderCompositedLayers(GraphicsContext&, const IntRect& clip);
+
private:
- QWebFrameAdapter* m_frame;
+ QWebPageClient* pageClient() const;
+
+ QWebFrameAdapter& m_frame;
std::unique_ptr<GraphicsLayer> m_rootGraphicsLayer;
Timer m_syncTimer;
WebCore::TextureMapperLayer* m_rootTextureMapperLayer;
diff --git a/Source/WebKit/qt/WidgetApi/qgraphicswebview.cpp b/Source/WebKit/qt/WidgetApi/qgraphicswebview.cpp
index 89ea0468e..79eb12d98 100644
--- a/Source/WebKit/qt/WidgetApi/qgraphicswebview.cpp
+++ b/Source/WebKit/qt/WidgetApi/qgraphicswebview.cpp
@@ -119,8 +119,8 @@ void QGraphicsWebViewPrivate::updateResizesToContentsForPage()
QObject::disconnect(page->mainFrame(), SIGNAL(contentsSizeChanged(QSize)),
q, SLOT(_q_contentsSizeChanged(const QSize&)));
}
- page->d->mainFrameAdapter()->setPaintsEntireContents(resizesToContents);
- page->d->mainFrameAdapter()->setDelegatesScrolling(resizesToContents);
+ page->d->mainFrameAdapter().setPaintsEntireContents(resizesToContents);
+ page->d->mainFrameAdapter().setDelegatesScrolling(resizesToContents);
}
void QGraphicsWebViewPrivate::_q_contentsSizeChanged(const QSize& size)
diff --git a/Source/WebKit/qt/WidgetApi/qwebpage.cpp b/Source/WebKit/qt/WidgetApi/qwebpage.cpp
index 5bb2f315d..11b5a9dd6 100644
--- a/Source/WebKit/qt/WidgetApi/qwebpage.cpp
+++ b/Source/WebKit/qt/WidgetApi/qwebpage.cpp
@@ -328,9 +328,9 @@ QWebFullScreenVideoHandler *QWebPagePrivate::createFullScreenVideoHandler()
}
#endif
-QWebFrameAdapter *QWebPagePrivate::mainFrameAdapter()
+QWebFrameAdapter& QWebPagePrivate::mainFrameAdapter()
{
- return q->mainFrame()->d;
+ return *q->mainFrame()->d;
}
QStringList QWebPagePrivate::chooseFiles(QWebFrameAdapter *frame, bool allowMultiple, const QStringList &suggestedFileNames)
@@ -1222,6 +1222,48 @@ QWebInspector* QWebPagePrivate::getOrCreateInspector()
\value WebModalDialog The window acts as modal dialog.
*/
+/*!
+ \enum QWebPage::PermissionPolicy
+
+ This enum describes the permission policies that the user may set for data or device access.
+
+ \value PermissionUnknown It is unknown whether the user grants or denies permission.
+ \value PermissionGrantedByUser The user has granted permission.
+ \value PermissionDeniedByUser The user has denied permission.
+
+ \sa featurePermissionRequested(), featurePermissionRequestCanceled(), setFeaturePermission(), Feature
+*/
+
+/*!
+ \enum QWebPage::Feature
+
+ This enum describes the platform feature access categories that the user may be asked to grant or deny access to.
+
+ \value Notifications Access to notifications
+ \value Geolocation Access to location hardware or service
+
+ \sa featurePermissionRequested(), featurePermissionRequestCanceled(), setFeaturePermission(), PermissionPolicy
+
+*/
+
+/*!
+ \fn void QWebPage::featurePermissionRequested(QWebFrame* frame, QWebPage::Feature feature);
+
+ This is signal is emitted when the given \a frame requests to make use of
+ the resource or device identified by \a feature.
+
+ \sa featurePermissionRequestCanceled(), setFeaturePermission()
+*/
+
+/*!
+ \fn void QWebPage::featurePermissionRequestCanceled(QWebFrame* frame, QWebPage::Feature feature);
+
+ This is signal is emitted when the given \a frame cancels a previously issued
+ request to make use of \a feature.
+
+ \sa featurePermissionRequested(), setFeaturePermission()
+
+*/
/*!
\class QWebPage::ViewportAttributes
@@ -1623,6 +1665,13 @@ bool QWebPage::shouldInterruptJavaScript()
#endif
}
+/*!
+ \fn void QWebPage::setFeaturePermission(QWebFrame* frame, Feature feature, PermissionPolicy policy)
+
+ Sets the permission for the given \a frame to use \a feature to \a policy.
+
+ \sa featurePermissionRequested(), featurePermissionRequestCanceled()
+*/
void QWebPage::setFeaturePermission(QWebFrame* frame, Feature feature, PermissionPolicy policy)
{
#if !ENABLE(NOTIFICATIONS) && !ENABLE(LEGACY_NOTIFICATIONS) && !ENABLE(GEOLOCATION)
@@ -1959,11 +2008,11 @@ void QWebPage::setViewportSize(const QSize &size) const
d->updateWindow();
- QWebFrameAdapter* mainFrame = d->mainFrameAdapter();
- if (!mainFrame->hasView())
+ QWebFrameAdapter& mainFrame = d->mainFrameAdapter();
+ if (!mainFrame.hasView())
return;
- mainFrame->setViewportSize(size);
+ mainFrame.setViewportSize(size);
}
void QWebPagePrivate::updateWindow()
@@ -2112,11 +2161,11 @@ void QWebPage::setPreferredContentsSize(const QSize& size) const
d->fixedLayoutSize = size;
- QWebFrameAdapter* mainFrame = d->mainFrameAdapter();
- if (!mainFrame->hasView())
+ QWebFrameAdapter& mainFrame = d->mainFrameAdapter();
+ if (!mainFrame.hasView())
return;
- mainFrame->setCustomLayoutSize(size);
+ mainFrame.setCustomLayoutSize(size);
}
/*
@@ -2131,11 +2180,11 @@ void QWebPage::setPreferredContentsSize(const QSize& size) const
*/
void QWebPage::setActualVisibleContentRect(const QRect& rect) const
{
- QWebFrameAdapter* mainFrame = d->mainFrameAdapter();
- if (!mainFrame->hasView())
+ QWebFrameAdapter& mainFrame = d->mainFrameAdapter();
+ if (!mainFrame.hasView())
return;
- mainFrame->setFixedVisibleContentRect(rect);
+ mainFrame.setFixedVisibleContentRect(rect);
}
/*!
diff --git a/Source/WebKit/qt/WidgetApi/qwebpage_p.h b/Source/WebKit/qt/WidgetApi/qwebpage_p.h
index 49e67af97..7b2c7ff6f 100644
--- a/Source/WebKit/qt/WidgetApi/qwebpage_p.h
+++ b/Source/WebKit/qt/WidgetApi/qwebpage_p.h
@@ -97,7 +97,7 @@ public:
#if USE(QT_MULTIMEDIA)
QWebFullScreenVideoHandler* createFullScreenVideoHandler() override;
#endif
- QWebFrameAdapter* mainFrameAdapter() override;
+ QWebFrameAdapter& mainFrameAdapter() override;
QStringList chooseFiles(QWebFrameAdapter*, bool allowMultiple, const QStringList& suggestedFileNames) override;
QColor colorSelectionRequested(const QColor& selectedColor) override;
std::unique_ptr<QWebSelectMethod> createSelectPopup() override;