From 70f6ec32f2dd554e67f39262db02f4769d973474 Mon Sep 17 00:00:00 2001 From: Michael Nutt Date: Fri, 13 Dec 2024 23:02:59 -0500 Subject: [PATCH] misc small fixes from upstream --- Source/WebCore/accessibility/qt/AXObjectCacheQt.cpp | 5 +++-- Source/WebCore/page/qt/EventHandlerQt.cpp | 3 ++- Source/WebCore/platform/graphics/FontPlatformData.h | 9 +++++++++ .../platform/graphics/qt/texmap/BitmapTexture.cpp | 2 +- Source/WebCore/platform/network/qt/SharedCookieJarQt.cpp | 1 + Source/WebCore/platform/text/PlatformLocale.h | 2 +- Source/WebKitLegacy/qt/WebCoreSupport/ChromeClientQt.cpp | 1 + .../qt/WebCoreSupport/DumpRenderTreeSupportQt.cpp | 1 + .../WebKitLegacy/qt/WebCoreSupport/QWebFrameAdapter.cpp | 2 ++ .../WebKitLegacy/qt/WebCoreSupport/QWebPageAdapter.cpp | 6 ++++-- 10 files changed, 25 insertions(+), 7 deletions(-) diff --git a/Source/WebCore/accessibility/qt/AXObjectCacheQt.cpp b/Source/WebCore/accessibility/qt/AXObjectCacheQt.cpp index 6bc3bedcd52a9..5bd6fd330f773 100644 --- a/Source/WebCore/accessibility/qt/AXObjectCacheQt.cpp +++ b/Source/WebCore/accessibility/qt/AXObjectCacheQt.cpp @@ -32,6 +32,7 @@ #include "HTMLSelectElement.h" #include "LocalFrame.h" #include "Page.h" +#include "NotImplemented.h" namespace WebCore { @@ -63,7 +64,7 @@ void AXObjectCache::frameLoadingEventPlatformNotification(AccessibilityObject*, void AXObjectCache::handleScrolledToAnchor(const Node& scrolledToNode) { if (RefPtr object = AccessibilityObject::firstAccessibleObjectFromNode(&scrolledToNode)) - postPlatformNotification(*object, AXScrolledToAnchor); + postPlatformNotification(*object, AXNotification::ScrolledToAnchor); } void AXObjectCache::platformHandleFocusedUIElementChanged(Element*, Element* newFocusedNode) @@ -76,7 +77,7 @@ void AXObjectCache::platformHandleFocusedUIElementChanged(Element*, Element* new return; if (RefPtr focusedObject = focusedObjectForPage(page)) - postPlatformNotification(*focusedObject, AXFocusedUIElementChanged); + postPlatformNotification(*focusedObject, AXNotification::FocusedUIElementChanged); } void AXObjectCache::platformPerformDeferredCacheUpdate() diff --git a/Source/WebCore/page/qt/EventHandlerQt.cpp b/Source/WebCore/page/qt/EventHandlerQt.cpp index 4a710dc108077..b4533c8bb342a 100644 --- a/Source/WebCore/page/qt/EventHandlerQt.cpp +++ b/Source/WebCore/page/qt/EventHandlerQt.cpp @@ -86,7 +86,8 @@ bool EventHandler::passWheelEventToWidget(const PlatformWheelEvent& event, Widge if (!widget.isLocalFrameView()) return false; - return downcast(widget).frame().eventHandler().handleWheelEvent(event, { }).wasHandled(); + auto [result, _] = downcast(widget).frame().eventHandler().handleWheelEvent(event, { }); + return result.wasHandled(); } HandleUserInputEventResult EventHandler::passMousePressEventToSubframe(MouseEventWithHitTestResults& mev, LocalFrame& subframe) diff --git a/Source/WebCore/platform/graphics/FontPlatformData.h b/Source/WebCore/platform/graphics/FontPlatformData.h index e448db4fe01d2..d8e04abc30553 100644 --- a/Source/WebCore/platform/graphics/FontPlatformData.h +++ b/Source/WebCore/platform/graphics/FontPlatformData.h @@ -258,6 +258,15 @@ struct FontPlatformSerializedData { LOGFONT logFont; #endif }; +#elif PLATFORM(QT) +struct FontPlatformSerializedCreationData { + Vector fontFaceData; + String itemInCollection; +}; + +struct FontPlatformSerializedData { + QRawFont rawFont; +}; #endif #if PLATFORM(QT) diff --git a/Source/WebCore/platform/graphics/qt/texmap/BitmapTexture.cpp b/Source/WebCore/platform/graphics/qt/texmap/BitmapTexture.cpp index 1a9a32c463831..68f9249f980b0 100644 --- a/Source/WebCore/platform/graphics/qt/texmap/BitmapTexture.cpp +++ b/Source/WebCore/platform/graphics/qt/texmap/BitmapTexture.cpp @@ -40,7 +40,7 @@ void BitmapTexture::updateContents(GraphicsLayer* sourceLayer, const IntRect& ta { // Making an unconditionally unaccelerated buffer here is OK because this code // isn't used by any platforms that respect the accelerated bit. - auto imageBuffer = ImageBuffer::create(targetRect.size(), RenderingPurpose::Unspecified, 1, DestinationColorSpace::SRGB(), ImageBufferPixelFormat::BGRA8); + auto imageBuffer = ImageBuffer::create(targetRect.size(), RenderingMode::Unaccelerated, RenderingPurpose::Unspecified, 1, DestinationColorSpace::SRGB(), ImageBufferPixelFormat::BGRA8); if (!imageBuffer) return; diff --git a/Source/WebCore/platform/network/qt/SharedCookieJarQt.cpp b/Source/WebCore/platform/network/qt/SharedCookieJarQt.cpp index 8923aee912ab5..a4b931aa76f8e 100644 --- a/Source/WebCore/platform/network/qt/SharedCookieJarQt.cpp +++ b/Source/WebCore/platform/network/qt/SharedCookieJarQt.cpp @@ -35,6 +35,7 @@ #include #include #include +#include namespace WebCore { diff --git a/Source/WebCore/platform/text/PlatformLocale.h b/Source/WebCore/platform/text/PlatformLocale.h index 8d3fa79f2e7e8..7052c4d9dcf5e 100644 --- a/Source/WebCore/platform/text/PlatformLocale.h +++ b/Source/WebCore/platform/text/PlatformLocale.h @@ -65,7 +65,7 @@ class Locale { RightToLeft }; -#if PLATFORM(GTK) || PLATFORM(WPE) || PLATFORM(COCOA) +#if PLATFORM(GTK) || PLATFORM(WPE) || PLATFORM(COCOA) || PLATFORM(QT) // Returns the default writing direction for the specified locale. virtual WritingDirection defaultWritingDirection() const = 0; #endif diff --git a/Source/WebKitLegacy/qt/WebCoreSupport/ChromeClientQt.cpp b/Source/WebKitLegacy/qt/WebCoreSupport/ChromeClientQt.cpp index d7f4e299a8a51..0cb06814092e2 100644 --- a/Source/WebKitLegacy/qt/WebCoreSupport/ChromeClientQt.cpp +++ b/Source/WebKitLegacy/qt/WebCoreSupport/ChromeClientQt.cpp @@ -46,6 +46,7 @@ #include #include #include +#include #include #include #include diff --git a/Source/WebKitLegacy/qt/WebCoreSupport/DumpRenderTreeSupportQt.cpp b/Source/WebKitLegacy/qt/WebCoreSupport/DumpRenderTreeSupportQt.cpp index b82c0c03ef42b..91358b2011c95 100644 --- a/Source/WebKitLegacy/qt/WebCoreSupport/DumpRenderTreeSupportQt.cpp +++ b/Source/WebKitLegacy/qt/WebCoreSupport/DumpRenderTreeSupportQt.cpp @@ -43,6 +43,7 @@ #include #include #include +#include #include #include #include diff --git a/Source/WebKitLegacy/qt/WebCoreSupport/QWebFrameAdapter.cpp b/Source/WebKitLegacy/qt/WebCoreSupport/QWebFrameAdapter.cpp index 77c857024577b..77b1395f9b392 100644 --- a/Source/WebKitLegacy/qt/WebCoreSupport/QWebFrameAdapter.cpp +++ b/Source/WebKitLegacy/qt/WebCoreSupport/QWebFrameAdapter.cpp @@ -37,10 +37,12 @@ #include #include #include +#include #include #include #include #include +#include #include #include #include diff --git a/Source/WebKitLegacy/qt/WebCoreSupport/QWebPageAdapter.cpp b/Source/WebKitLegacy/qt/WebCoreSupport/QWebPageAdapter.cpp index 8cebf5d76ab56..28bd1de9d97e6 100644 --- a/Source/WebKitLegacy/qt/WebCoreSupport/QWebPageAdapter.cpp +++ b/Source/WebKitLegacy/qt/WebCoreSupport/QWebPageAdapter.cpp @@ -97,12 +97,14 @@ #include #include #include +#include #include #include #include #include #include #include +#include #include #include #include @@ -704,8 +706,8 @@ void QWebPageAdapter::wheelEvent(QWheelEvent *ev, int wheelScrollLines) return; PlatformWheelEvent pev = convertWheelEvent(ev, wheelScrollLines); - bool accepted = frame->eventHandler().handleWheelEvent(pev, { WheelEventProcessingSteps::SynchronousScrolling, WheelEventProcessingSteps::BlockingDOMEventDispatch }).wasHandled(); - ev->setAccepted(accepted); + auto [result, _] = frame->eventHandler().handleWheelEvent(pev, { WheelEventProcessingSteps::SynchronousScrolling, WheelEventProcessingSteps::BlockingDOMEventDispatch }); + ev->setAccepted(result.wasHandled()); } #endif // QT_NO_WHEELEVENT