diff options
author | Konstantin Tokarev <annulen@yandex.ru> | 2016-09-28 16:39:37 +0300 |
---|---|---|
committer | Konstantin Tokarev <annulen@yandex.ru> | 2017-02-02 12:31:01 +0000 |
commit | 9daf1655d7e4eaaa6ed5f44055a4b4fd399fd25c (patch) | |
tree | 322337ad0acbc75732f916376ec6d36e7ec0e5bc /Source/WebKit2/WebProcess/WebPage | |
parent | 6882a04fb36642862b11efe514251d32070c3d65 (diff) | |
download | qtwebkit-9daf1655d7e4eaaa6ed5f44055a4b4fd399fd25c.tar.gz |
Imported WebKit commit eb954cdcf58f9b915b2fcb6f8e4cb3a60650a4f3
Change-Id: I8dda875c38075d43b76fe3a21acb0ffa102bb82d
Reviewed-by: Konstantin Tokarev <annulen@yandex.ru>
Diffstat (limited to 'Source/WebKit2/WebProcess/WebPage')
-rw-r--r-- | Source/WebKit2/WebProcess/WebPage/TapHighlightController.cpp | 12 | ||||
-rw-r--r-- | Source/WebKit2/WebProcess/WebPage/TapHighlightController.h | 11 | ||||
-rw-r--r-- | Source/WebKit2/WebProcess/WebPage/WebPage.cpp | 10 | ||||
-rw-r--r-- | Source/WebKit2/WebProcess/WebPage/WebPage.h | 1 | ||||
-rw-r--r-- | Source/WebKit2/WebProcess/WebPage/qt/WebInspectorUIQt.cpp (renamed from Source/WebKit2/WebProcess/WebPage/qt/WebInspectorQt.cpp) | 9 | ||||
-rw-r--r-- | Source/WebKit2/WebProcess/WebPage/qt/WebPageQt.cpp | 4 |
6 files changed, 24 insertions, 23 deletions
diff --git a/Source/WebKit2/WebProcess/WebPage/TapHighlightController.cpp b/Source/WebKit2/WebProcess/WebPage/TapHighlightController.cpp index 508595b0f..e086edab4 100644 --- a/Source/WebKit2/WebProcess/WebPage/TapHighlightController.cpp +++ b/Source/WebKit2/WebProcess/WebPage/TapHighlightController.cpp @@ -75,11 +75,11 @@ void TapHighlightController::hideHighlight() m_webPage->mainFrame()->pageOverlayController().uninstallPageOverlay(m_overlay, PageOverlay::FadeMode::Fade); } -void TapHighlightController::pageOverlayDestroyed(PageOverlay*) +void TapHighlightController::pageOverlayDestroyed(PageOverlay&) { } -void TapHighlightController::willMoveToWebPage(PageOverlay*, WebPage* webPage) +void TapHighlightController::willMoveToPage(PageOverlay&, WebCore::Page* webPage) { if (webPage) return; @@ -89,7 +89,7 @@ void TapHighlightController::willMoveToWebPage(PageOverlay*, WebPage* webPage) m_overlay = 0; } -void TapHighlightController::didMoveToWebPage(PageOverlay*, WebPage*) +void TapHighlightController::didMoveToPage(PageOverlay&, WebCore::Page*) { } @@ -98,19 +98,19 @@ static Color highlightColor(Color baseColor, float fractionFadedIn) return Color(baseColor.red(), baseColor.green(), baseColor.blue(), int(baseColor.alpha() * fractionFadedIn)); } -void TapHighlightController::drawRect(PageOverlay* /*pageOverlay*/, GraphicsContext& context, const IntRect& /*dirtyRect*/) +void TapHighlightController::drawRect(PageOverlay& /*pageOverlay*/, GraphicsContext& context, const IntRect& /*dirtyRect*/) { if (m_path.isEmpty()) return; { GraphicsContextStateSaver stateSaver(context); - context.setFillColor(highlightColor(m_color, 0.5f), ColorSpaceSRGB); + context.setFillColor(highlightColor(m_color, 0.5f)); context.fillPath(m_path); } } -bool TapHighlightController::mouseEvent(PageOverlay*, const WebMouseEvent&) +bool TapHighlightController::mouseEvent(PageOverlay&, const WebCore::PlatformMouseEvent&) { return false; } diff --git a/Source/WebKit2/WebProcess/WebPage/TapHighlightController.h b/Source/WebKit2/WebProcess/WebPage/TapHighlightController.h index 5c39f7e64..f78b7f469 100644 --- a/Source/WebKit2/WebProcess/WebPage/TapHighlightController.h +++ b/Source/WebKit2/WebProcess/WebPage/TapHighlightController.h @@ -36,6 +36,7 @@ namespace WebCore { class Frame; class IntRect; class Node; +class Page; } namespace WebKit { @@ -54,11 +55,11 @@ public: private: // PageOverlay::Client. - virtual void pageOverlayDestroyed(WebCore::PageOverlay*); - virtual void willMoveToWebPage(WebCore::PageOverlay*, WebPage*); - virtual void didMoveToWebPage(WebCore::PageOverlay*, WebPage*); - virtual bool mouseEvent(WebCore::PageOverlay*, const WebMouseEvent&); - virtual void drawRect(WebCore::PageOverlay*, WebCore::GraphicsContext&, const WebCore::IntRect& dirtyRect); + void pageOverlayDestroyed(WebCore::PageOverlay&) override; + void willMoveToPage(WebCore::PageOverlay&, WebCore::Page*) override; + void didMoveToPage(WebCore::PageOverlay&, WebCore::Page*) override; + bool mouseEvent(WebCore::PageOverlay&, const WebCore::PlatformMouseEvent&) override; + void drawRect(WebCore::PageOverlay&, WebCore::GraphicsContext&, const WebCore::IntRect& dirtyRect) override; private: WebPage* m_webPage; diff --git a/Source/WebKit2/WebProcess/WebPage/WebPage.cpp b/Source/WebKit2/WebProcess/WebPage/WebPage.cpp index 71fe0688e..2cd709f22 100644 --- a/Source/WebKit2/WebProcess/WebPage/WebPage.cpp +++ b/Source/WebKit2/WebProcess/WebPage/WebPage.cpp @@ -834,8 +834,8 @@ EditorState WebPage::editorState(IncludePostLayoutDataHint shouldIncludePostLayo if (!scope) return result; - if (isHTMLInputElement(scope)) { - HTMLInputElement* input = toHTMLInputElement(scope); + if (is<HTMLInputElement>(scope)) { + HTMLInputElement* input = downcast<HTMLInputElement>(scope); if (input->isTelephoneField()) result.inputMethodHints |= Qt::ImhDialableCharactersOnly; else if (input->isNumberField()) @@ -881,8 +881,8 @@ EditorState WebPage::editorState(IncludePostLayoutDataHint shouldIncludePostLayo // FIXME: We should only transfer innerText when it changes and do this on the UI side. if (result.isContentEditable) { - if (isHTMLTextFormControlElement(scope)) - result.surroundingText = toHTMLTextFormControlElement(scope)->innerTextValue(); + if (is<HTMLTextFormControlElement>(scope)) + result.surroundingText = downcast<HTMLTextFormControlElement>(scope)->innerTextValue(); else result.surroundingText = scope->innerText(); @@ -2306,7 +2306,7 @@ void WebPage::highlightPotentialActivation(const IntPoint& point, const IntSize& break; // We always highlight focusable (form-elements), image links or content-editable elements. - if ((node->isElementNode() && toElement(node)->isMouseFocusable()) || node->isLink() || node->isContentEditable()) + if ((node->isElementNode() && downcast<Element>(node)->isMouseFocusable()) || node->isLink() || node->isContentEditable()) activationNode = node; else if (node->willRespondToMouseClickEvents()) { // Highlight elements with default mouse-click handlers, but highlight only inline elements with diff --git a/Source/WebKit2/WebProcess/WebPage/WebPage.h b/Source/WebKit2/WebProcess/WebPage/WebPage.h index 0a7516c12..8be9a42a9 100644 --- a/Source/WebKit2/WebProcess/WebPage/WebPage.h +++ b/Source/WebKit2/WebProcess/WebPage/WebPage.h @@ -83,6 +83,7 @@ #include "QtNetworkReply.h" #include "QtNetworkReplyData.h" #include "QtNetworkRequestData.h" +#include "TapHighlightController.h" #include <QNetworkReply> #include <QNetworkRequest> #endif diff --git a/Source/WebKit2/WebProcess/WebPage/qt/WebInspectorQt.cpp b/Source/WebKit2/WebProcess/WebPage/qt/WebInspectorUIQt.cpp index 1d7d539cc..838627309 100644 --- a/Source/WebKit2/WebProcess/WebPage/qt/WebInspectorQt.cpp +++ b/Source/WebKit2/WebProcess/WebPage/qt/WebInspectorUIQt.cpp @@ -24,7 +24,7 @@ */ #include "config.h" -#include "WebInspector.h" +#include "WebInspectorUI.h" #if ENABLE(INSPECTOR) @@ -33,15 +33,14 @@ namespace WebKit { -bool WebInspector::canSave() const +bool WebInspectorUI::canSave() { return false; } -String WebInspector::localizedStringsURL() const +String WebInspectorUI::localizedStringsURL() { - notImplemented(); - return String(); + return ASCIILiteral("qrc:///org/webkitgtk/inspector/Localizations/en.lproj/localizedStrings.js"); } } // namespace WebKit diff --git a/Source/WebKit2/WebProcess/WebPage/qt/WebPageQt.cpp b/Source/WebKit2/WebProcess/WebPage/qt/WebPageQt.cpp index 6ee8a1d12..654829487 100644 --- a/Source/WebKit2/WebProcess/WebPage/qt/WebPageQt.cpp +++ b/Source/WebKit2/WebProcess/WebPage/qt/WebPageQt.cpp @@ -300,7 +300,7 @@ PassRefPtr<SharedBuffer> WebPage::cachedResponseDataForURL(const URL&) void WebPage::registerApplicationScheme(const String& scheme) { - QtNetworkAccessManager* qnam = qobject_cast<QtNetworkAccessManager*>(WebProcess::shared().networkAccessManager()); + QtNetworkAccessManager* qnam = qobject_cast<QtNetworkAccessManager*>(WebProcess::singleton().networkAccessManager()); if (!qnam) return; qnam->registerApplicationScheme(this, QString(scheme)); @@ -334,7 +334,7 @@ void WebPage::hidePopupMenu() return; m_activePopupMenu->client()->popupDidHide(); - m_activePopupMenu = 0; + m_activePopupMenu = nullptr; } } // namespace WebKit |