From 65f03d4f644ce73618e5f4f50dd694b26f55ae12 Mon Sep 17 00:00:00 2001 From: Ben Murdoch Date: Fri, 13 May 2011 16:23:25 +0100 Subject: Merge WebKit at r75993: Initial merge by git. Change-Id: I602bbdc3974787a3b0450456a30a7868286921c3 --- Source/WebCore/platform/ContextMenuItem.h | 3 - Source/WebCore/platform/DragData.cpp | 13 +- Source/WebCore/platform/DragData.h | 94 +- Source/WebCore/platform/FileSystem.h | 1 + Source/WebCore/platform/Pasteboard.h | 8 +- Source/WebCore/platform/PlatformWheelEvent.h | 30 +- Source/WebCore/platform/SchemeRegistry.cpp | 57 +- Source/WebCore/platform/SchemeRegistry.h | 10 +- Source/WebCore/platform/UUID.cpp | 8 +- Source/WebCore/platform/Widget.cpp | 4 + Source/WebCore/platform/Widget.h | 1 + .../WebCore/platform/android/DragDataAndroid.cpp | 8 +- Source/WebCore/platform/chromium/ChromiumBridge.h | 4 - .../platform/chromium/ClipboardUtilitiesChromium.h | 5 + .../WebCore/platform/chromium/DragDataChromium.cpp | 13 +- .../chromium/GeolocationServiceChromium.cpp | 114 -- .../platform/chromium/GeolocationServiceChromium.h | 87 -- .../platform/chromium/PopupMenuChromium.cpp | 54 +- .../WebCore/platform/chromium/PopupMenuChromium.h | 5 +- Source/WebCore/platform/efl/DragDataEfl.cpp | 8 +- Source/WebCore/platform/efl/PasteboardEfl.cpp | 5 - Source/WebCore/platform/efl/RenderThemeEfl.cpp | 1 + .../WebCore/platform/graphics/GraphicsContext.cpp | 1 + Source/WebCore/platform/graphics/GraphicsContext.h | 3 +- .../platform/graphics/GraphicsContext3D.cpp | 114 +- .../WebCore/platform/graphics/GraphicsContext3D.h | 18 +- Source/WebCore/platform/graphics/GraphicsLayer.h | 5 + Source/WebCore/platform/graphics/ImageSource.cpp | 12 +- Source/WebCore/platform/graphics/Pen.cpp | 77 -- Source/WebCore/platform/graphics/Pen.h | 72 -- .../platform/graphics/ca/GraphicsLayerCA.cpp | 48 +- .../WebCore/platform/graphics/ca/GraphicsLayerCA.h | 10 +- .../WebCore/platform/graphics/ca/PlatformCALayer.h | 3 + .../platform/graphics/ca/mac/PlatformCALayerMac.mm | 20 + .../graphics/ca/win/PlatformCALayerWin.cpp | 28 +- .../graphics/ca/win/PlatformCALayerWinInternal.cpp | 21 + .../graphics/ca/win/PlatformCALayerWinInternal.h | 1 + .../platform/graphics/cairo/DrawErrorUnderline.h | 5 + .../cairo/GraphicsContextPlatformPrivateCairo.h | 4 + .../WebCore/platform/graphics/cairo/PathCairo.cpp | 25 +- .../platform/graphics/cg/GraphicsContextCG.cpp | 47 +- .../graphics/cg/GraphicsContextPlatformPrivateCG.h | 5 + .../WebCore/platform/graphics/cg/ImageBufferCG.cpp | 11 +- .../platform/graphics/cg/PDFDocumentImage.h | 5 + .../chromium/ComplexTextControllerLinux.cpp | 141 +-- .../graphics/chromium/ComplexTextControllerLinux.h | 7 +- .../graphics/chromium/DrawingBufferChromium.cpp | 8 +- .../platform/graphics/chromium/FontLinux.cpp | 56 +- .../platform/graphics/chromium/LayerTexture.h | 5 + .../graphics/chromium/LayerTilerChromium.cpp | 6 + .../graphics/chromium/RenderSurfaceChromium.cpp | 3 + .../platform/graphics/chromium/TextureManager.cpp | 5 + .../platform/graphics/chromium/TextureManager.h | 1 + .../WebCore/platform/graphics/filters/FEBlend.cpp | 2 + .../platform/graphics/filters/FEColorMatrix.cpp | 2 + .../graphics/filters/FEComponentTransfer.cpp | 2 + .../platform/graphics/filters/FEComposite.cpp | 2 + .../platform/graphics/filters/FEConvolveMatrix.cpp | 2 + .../graphics/filters/FEDiffuseLighting.cpp | 2 + .../graphics/filters/FEDisplacementMap.cpp | 2 + .../WebCore/platform/graphics/filters/FEFlood.cpp | 2 + .../platform/graphics/filters/FEGaussianBlur.cpp | 2 + .../WebCore/platform/graphics/filters/FEMerge.cpp | 2 + .../platform/graphics/filters/FEMorphology.cpp | 2 + .../WebCore/platform/graphics/filters/FEOffset.cpp | 2 + .../graphics/filters/FESpecularLighting.cpp | 2 + .../WebCore/platform/graphics/filters/FETile.cpp | 2 + .../platform/graphics/filters/FETurbulence.cpp | 2 + .../platform/graphics/filters/FilterEffect.cpp | 3 + .../platform/graphics/filters/FilterEffect.h | 12 +- .../platform/graphics/filters/SourceAlpha.cpp | 4 +- .../platform/graphics/filters/SourceGraphic.cpp | 4 +- .../platform/graphics/gpu/DrawingBuffer.cpp | 35 +- .../WebCore/platform/graphics/gpu/DrawingBuffer.h | 6 +- .../platform/graphics/gpu/mac/DrawingBufferMac.mm | 23 +- .../graphics/gstreamer/GStreamerGWorld.cpp | 3 +- .../graphics/gstreamer/PlatformVideoWindow.h | 13 + .../graphics/gstreamer/PlatformVideoWindowMac.mm | 49 + .../graphics/haiku/GraphicsContextHaiku.cpp | 1 - .../platform/graphics/qt/GraphicsContextQt.cpp | 13 +- .../platform/graphics/qt/GraphicsLayerQt.cpp | 7 +- .../WebCore/platform/graphics/qt/GraphicsLayerQt.h | 3 + .../platform/graphics/qt/ImageDecoderQt.cpp | 14 +- .../WebCore/platform/graphics/qt/ImageDecoderQt.h | 2 +- Source/WebCore/platform/graphics/qt/ImageQt.cpp | 28 +- .../platform/graphics/qt/MediaPlayerPrivateQt.cpp | 18 +- .../platform/graphics/qt/MediaPlayerPrivateQt.h | 8 +- .../graphics/skia/BitmapImageSingleFrameSkia.h | 2 + .../platform/graphics/skia/ImageBufferSkia.cpp | 9 +- .../WebCore/platform/graphics/skia/ImageSkia.cpp | 2 +- .../win/MediaPlayerPrivateFullscreenWindow.cpp | 14 +- .../WebCore/platform/graphics/win/WKCACFLayer.cpp | 572 --------- Source/WebCore/platform/graphics/win/WKCACFLayer.h | 299 ----- .../platform/graphics/win/WKCACFLayerRenderer.cpp | 60 +- .../platform/graphics/win/WKCACFLayerRenderer.h | 17 +- .../WebCore/platform/graphics/wince/ImageWinCE.cpp | 2 +- .../platform/graphics/wx/GraphicsContextWx.cpp | 1 - Source/WebCore/platform/graphics/wx/PenWx.cpp | 77 -- Source/WebCore/platform/gtk/ContextMenuGtk.cpp | 17 +- Source/WebCore/platform/gtk/ContextMenuItemGtk.cpp | 55 +- Source/WebCore/platform/gtk/DragDataGtk.cpp | 13 +- Source/WebCore/platform/gtk/FileSystemGtk.cpp | 48 +- Source/WebCore/platform/gtk/GRefPtrGtk.cpp | 2 + Source/WebCore/platform/gtk/GRefPtrGtk.h | 2 + Source/WebCore/platform/gtk/GtkVersioning.h | 10 +- Source/WebCore/platform/gtk/RenderThemeGtk.cpp | 110 +- Source/WebCore/platform/gtk/RenderThemeGtk.h | 53 +- Source/WebCore/platform/gtk/RenderThemeGtk2.cpp | 108 +- Source/WebCore/platform/gtk/RenderThemeGtk3.cpp | 610 ++++++--- .../platform/gtk/WidgetRenderingContext.cpp | 192 +++ .../WebCore/platform/gtk/WidgetRenderingContext.h | 10 +- .../platform/gtk/WidgetRenderingContextGtk2.cpp | 191 --- .../platform/gtk/WidgetRenderingContextGtk3.cpp | 73 -- Source/WebCore/platform/gtk/gtk3drawing.c | 1288 -------------------- Source/WebCore/platform/gtk/gtkdrawing.h | 9 - Source/WebCore/platform/haiku/DragDataHaiku.cpp | 8 +- .../platform/image-decoders/ImageDecoder.cpp | 26 +- .../WebCore/platform/image-decoders/ImageDecoder.h | 20 +- .../image-decoders/bmp/BMPImageDecoder.cpp | 8 +- .../platform/image-decoders/bmp/BMPImageDecoder.h | 2 +- .../platform/image-decoders/bmp/BMPImageReader.cpp | 6 +- .../platform/image-decoders/bmp/BMPImageReader.h | 6 +- .../image-decoders/cairo/ImageDecoderCairo.cpp | 2 +- .../platform/image-decoders/cg/ImageDecoderCG.cpp | 14 +- .../image-decoders/gif/GIFImageDecoder.cpp | 52 +- .../platform/image-decoders/gif/GIFImageDecoder.h | 4 +- .../platform/image-decoders/gif/GIFImageReader.cpp | 4 +- .../platform/image-decoders/gif/GIFImageReader.h | 4 +- .../image-decoders/haiku/ImageDecoderHaiku.cpp | 2 +- .../image-decoders/ico/ICOImageDecoder.cpp | 8 +- .../platform/image-decoders/ico/ICOImageDecoder.h | 2 +- .../image-decoders/jpeg/JPEGImageDecoder.cpp | 16 +- .../image-decoders/jpeg/JPEGImageDecoder.h | 2 +- .../image-decoders/openvg/ImageDecoderOpenVG.cpp | 2 +- .../image-decoders/png/PNGImageDecoder.cpp | 14 +- .../platform/image-decoders/png/PNGImageDecoder.h | 4 +- .../platform/image-decoders/qt/ImageFrameQt.cpp | 158 +++ .../platform/image-decoders/qt/RGBA32BufferQt.cpp | 158 --- .../image-decoders/skia/ImageDecoderSkia.cpp | 26 +- .../image-decoders/webp/WEBPImageDecoder.cpp | 12 +- .../image-decoders/webp/WEBPImageDecoder.h | 2 +- .../platform/image-decoders/wx/ImageDecoderWx.cpp | 2 +- .../image-encoders/skia/JPEGImageEncoder.cpp | 19 +- Source/WebCore/platform/mac/DragDataMac.mm | 76 +- Source/WebCore/platform/mac/PasteboardMac.mm | 45 +- Source/WebCore/platform/mac/ThemeMac.mm | 12 +- Source/WebCore/platform/mac/WheelEventMac.mm | 25 +- Source/WebCore/platform/mac/WidgetMac.mm | 84 +- .../platform/mock/SpeechInputClientMock.cpp | 16 +- .../platform/network/qt/NetworkStateNotifierQt.cpp | 4 +- .../platform/network/qt/QtNAMThreadSafeProxy.cpp | 28 +- .../platform/network/qt/QtNAMThreadSafeProxy.h | 44 +- .../network/soup/AuthenticationChallenge.h | 5 + .../platform/network/soup/ResourceHandleSoup.cpp | 13 +- .../network/soup/cache/soup-http-input-stream.c | 2 +- .../platform/network/win/ProxyServerWin.cpp | 37 + Source/WebCore/platform/qt/CookieJarQt.cpp | 16 +- Source/WebCore/platform/qt/DragDataQt.cpp | 15 +- Source/WebCore/platform/qt/PasteboardQt.cpp | 29 +- .../WebCore/platform/qt/PlatformMouseEventQt.cpp | 2 + Source/WebCore/platform/qt/RenderThemeQt.cpp | 98 +- Source/WebCore/platform/qt/RenderThemeQt.h | 4 +- Source/WebCore/platform/qt/WheelEventQt.cpp | 2 +- Source/WebCore/platform/win/DragDataWin.cpp | 15 +- Source/WebCore/platform/win/WebCoreTextRenderer.h | 5 + Source/WebCore/platform/wince/DragDataWinCE.cpp | 9 +- Source/WebCore/platform/wx/DragDataWx.cpp | 8 +- Source/WebCore/platform/wx/WidgetWx.cpp | 4 + 168 files changed, 2454 insertions(+), 4149 deletions(-) delete mode 100644 Source/WebCore/platform/chromium/GeolocationServiceChromium.cpp delete mode 100644 Source/WebCore/platform/chromium/GeolocationServiceChromium.h delete mode 100644 Source/WebCore/platform/graphics/Pen.cpp delete mode 100644 Source/WebCore/platform/graphics/Pen.h create mode 100644 Source/WebCore/platform/graphics/gstreamer/PlatformVideoWindowMac.mm delete mode 100644 Source/WebCore/platform/graphics/win/WKCACFLayer.cpp delete mode 100644 Source/WebCore/platform/graphics/win/WKCACFLayer.h delete mode 100644 Source/WebCore/platform/graphics/wx/PenWx.cpp create mode 100644 Source/WebCore/platform/gtk/WidgetRenderingContext.cpp delete mode 100644 Source/WebCore/platform/gtk/WidgetRenderingContextGtk2.cpp delete mode 100644 Source/WebCore/platform/gtk/WidgetRenderingContextGtk3.cpp delete mode 100644 Source/WebCore/platform/gtk/gtk3drawing.c create mode 100644 Source/WebCore/platform/image-decoders/qt/ImageFrameQt.cpp delete mode 100644 Source/WebCore/platform/image-decoders/qt/RGBA32BufferQt.cpp create mode 100644 Source/WebCore/platform/network/win/ProxyServerWin.cpp (limited to 'Source/WebCore/platform') diff --git a/Source/WebCore/platform/ContextMenuItem.h b/Source/WebCore/platform/ContextMenuItem.h index 441829f..145d795 100644 --- a/Source/WebCore/platform/ContextMenuItem.h +++ b/Source/WebCore/platform/ContextMenuItem.h @@ -42,7 +42,6 @@ class NSMenuItem; #elif PLATFORM(WIN) typedef struct tagMENUITEMINFOW MENUITEMINFO; #elif PLATFORM(GTK) -#include typedef struct _GtkMenuItem GtkMenuItem; #elif PLATFORM(QT) #include @@ -288,8 +287,6 @@ namespace WebCore { #else #if PLATFORM(MAC) RetainPtr m_platformDescription; -#elif PLATFORM(GTK) - GRefPtr m_platformDescription; #else PlatformMenuItemDescription m_platformDescription; #endif diff --git a/Source/WebCore/platform/DragData.cpp b/Source/WebCore/platform/DragData.cpp index 4518909..a61feab 100644 --- a/Source/WebCore/platform/DragData.cpp +++ b/Source/WebCore/platform/DragData.cpp @@ -31,13 +31,24 @@ namespace WebCore { #if !PLATFORM(MAC) DragData::DragData(DragDataRef data, const IntPoint& clientPosition, const IntPoint& globalPosition, - DragOperation sourceOperationMask) + DragOperation sourceOperationMask, DragApplicationFlags flags) : m_clientPosition(clientPosition) , m_globalPosition(globalPosition) , m_platformDragData(data) , m_draggingSourceOperationMask(sourceOperationMask) + , m_applicationFlags(flags) { } + +DragData::DragData(const String&, const IntPoint& clientPosition, const IntPoint& globalPosition, + DragOperation sourceOperationMask, DragApplicationFlags flags) + : m_clientPosition(clientPosition) + , m_globalPosition(globalPosition) + , m_platformDragData(0) + , m_draggingSourceOperationMask(sourceOperationMask) + , m_applicationFlags(flags) +{ +} #endif } // namespace WebCore diff --git a/Source/WebCore/platform/DragData.h b/Source/WebCore/platform/DragData.h index d90a424..3bd27fc 100644 --- a/Source/WebCore/platform/DragData.h +++ b/Source/WebCore/platform/DragData.h @@ -34,12 +34,15 @@ #include #if PLATFORM(MAC) +#include #ifdef __OBJC__ #import #import typedef id DragDataRef; +@class NSPasteboard; #else typedef void* DragDataRef; +class NSPasteboard; #endif #elif PLATFORM(QT) QT_BEGIN_NAMESPACE @@ -68,54 +71,61 @@ typedef void* DragDataRef; namespace WebCore { - - class Document; - class DocumentFragment; - class KURL; - -#if PLATFORM(MAC) - class PasteboardHelper; -#endif +class Frame; +class DocumentFragment; +class KURL; +class Range; + +enum DragApplicationFlags { + DragApplicationNone = 0, + DragApplicationIsModal = 1, + DragApplicationIsSource = 2, + DragApplicationHasAttachedSheet = 4, + DragApplicationIsCopyKeyDown = 8 +}; - class DragData { - public: - enum FilenameConversionPolicy { DoNotConvertFilenames, ConvertFilenames }; +class DragData { +public: + enum FilenameConversionPolicy { DoNotConvertFilenames, ConvertFilenames }; + // clientPosition is taken to be the position of the drag event within the target window, with (0,0) at the top left + DragData(DragDataRef, const IntPoint& clientPosition, const IntPoint& globalPosition, DragOperation, DragApplicationFlags = DragApplicationNone); + DragData(const String& dragStorageName, const IntPoint& clientPosition, const IntPoint& globalPosition, DragOperation, DragApplicationFlags = DragApplicationNone); + + const IntPoint& clientPosition() const { return m_clientPosition; } + const IntPoint& globalPosition() const { return m_globalPosition; } + DragApplicationFlags flags() { return m_applicationFlags; } + DragDataRef platformData() const { return m_platformDragData; } + DragOperation draggingSourceOperationMask() const { return m_draggingSourceOperationMask; } + bool containsURL(Frame*, FilenameConversionPolicy filenamePolicy = ConvertFilenames) const; + bool containsPlainText() const; + bool containsCompatibleContent() const; + String asURL(Frame*, FilenameConversionPolicy filenamePolicy = ConvertFilenames, String* title = 0) const; + String asPlainText(Frame*) const; + void asFilenames(Vector&) const; + Color asColor() const; + PassRefPtr asFragment(Frame*, PassRefPtr context, + bool allowPlainText, bool& chosePlainText) const; + bool canSmartReplace() const; + bool containsColor() const; + bool containsFiles() const; +private: + IntPoint m_clientPosition; + IntPoint m_globalPosition; + DragDataRef m_platformDragData; + DragOperation m_draggingSourceOperationMask; + DragApplicationFlags m_applicationFlags; #if PLATFORM(MAC) - //FIXME: In the future the WebKit functions provided by the helper class should be moved into WebCore, - //after which this constructor should be removed - DragData(DragDataRef data, const IntPoint& clientPosition, const IntPoint& globalPosition, - DragOperation operation, PasteboardHelper*); -#else - //clientPosition is taken to be the position of the drag event within the target window, with (0,0) at the top left - DragData(DragDataRef data, const IntPoint& clientPosition, const IntPoint& globalPosition, DragOperation operation); -#endif - const IntPoint& clientPosition() const { return m_clientPosition; } - const IntPoint& globalPosition() const { return m_globalPosition; } - DragDataRef platformData() const { return m_platformDragData; } - DragOperation draggingSourceOperationMask() const { return m_draggingSourceOperationMask; } - bool containsURL(FilenameConversionPolicy filenamePolicy = ConvertFilenames) const; - bool containsPlainText() const; - bool containsCompatibleContent() const; - String asURL(FilenameConversionPolicy filenamePolicy = ConvertFilenames, String* title = 0) const; - String asPlainText() const; - void asFilenames(Vector&) const; - Color asColor() const; - PassRefPtr asFragment(Document*) const; - bool canSmartReplace() const; - bool containsColor() const; - bool containsFiles() const; - private: - IntPoint m_clientPosition; - IntPoint m_globalPosition; - DragDataRef m_platformDragData; - DragOperation m_draggingSourceOperationMask; -#if PLATFORM(MAC) - PasteboardHelper* m_pasteboardHelper; + RetainPtr m_pasteboard; #endif }; -} //namespace WebCore +} +<<<<<<< HEAD #endif //!DragData_h +======= +#endif // !DragData_h + +>>>>>>> WebKit.org @ r75993 diff --git a/Source/WebCore/platform/FileSystem.h b/Source/WebCore/platform/FileSystem.h index 3b65d34..4f088e1 100644 --- a/Source/WebCore/platform/FileSystem.h +++ b/Source/WebCore/platform/FileSystem.h @@ -195,6 +195,7 @@ bool safeCreateFile(const String&, CFDataRef); #if PLATFORM(GTK) String filenameToString(const char*); String filenameForDisplay(const String&); +CString applicationDirectoryPath(); #endif #if PLATFORM(CHROMIUM) diff --git a/Source/WebCore/platform/Pasteboard.h b/Source/WebCore/platform/Pasteboard.h index 7c50737..78a40b3 100644 --- a/Source/WebCore/platform/Pasteboard.h +++ b/Source/WebCore/platform/Pasteboard.h @@ -88,6 +88,8 @@ public: static void writeSelection(NSPasteboard* pasteboard, Range* selectedRange, bool canSmartCopyOrDelete, Frame* frame); static void writeURL(NSPasteboard* pasteboard, NSArray* types, const KURL& url, const String& titleStr, Frame* frame); static void writePlainText(NSPasteboard* pasteboard, const String& text); + + Pasteboard(NSPasteboard *); #endif static Pasteboard* generalPasteboard(); @@ -97,11 +99,13 @@ public: void writeImage(Node*, const KURL&, const String& title); #if PLATFORM(MAC) void writeFileWrapperAsRTFDAttachment(NSFileWrapper*); + String asURL(Frame*); #endif void clear(); bool canSmartReplace(); PassRefPtr documentFragment(Frame*, PassRefPtr, bool allowPlainText, bool& chosePlainText); String plainText(Frame* = 0); + #if PLATFORM(QT) || PLATFORM(CHROMIUM) bool isSelectionMode() const; void setSelectionMode(bool selectionMode); @@ -110,17 +114,17 @@ public: #if PLATFORM(GTK) void setHelper(PasteboardHelper*); PasteboardHelper* helper(); + ~Pasteboard(); #endif private: Pasteboard(); - ~Pasteboard(); #if PLATFORM(MAC) - Pasteboard(NSPasteboard *); RetainPtr m_pasteboard; PassRefPtr documentFragmentWithImageResource(Frame* frame, PassRefPtr resource); PassRefPtr documentFragmentWithRtf(Frame* frame, NSString* pboardType); + NSURL *getBestURL(Frame *); #endif #if PLATFORM(WIN) diff --git a/Source/WebCore/platform/PlatformWheelEvent.h b/Source/WebCore/platform/PlatformWheelEvent.h index 6747392..1e5cd53 100644 --- a/Source/WebCore/platform/PlatformWheelEvent.h +++ b/Source/WebCore/platform/PlatformWheelEvent.h @@ -68,8 +68,22 @@ namespace WebCore { // and synthesized in other cases where platforms generate line-by-line scrolling events. // The ScrollByPageWheelEvent indicates that the wheel event should scroll an entire page. In this case WebCore's built in paging behavior is used to page // up and down (you get the same behavior as if the user was clicking in a scrollbar track to page up or page down). Page scrolling only works in the vertical direction. - enum PlatformWheelEventGranularity { ScrollByPageWheelEvent, ScrollByPixelWheelEvent }; - + enum PlatformWheelEventGranularity { + ScrollByPageWheelEvent, + ScrollByPixelWheelEvent + }; + +#if PLATFORM(MAC) + enum PlatformWheelEventPhase { + PlatformWheelEventPhaseNone = 0, + PlatformWheelEventPhaseBegan = 1 << 1, + PlatformWheelEventPhaseStationary = 1 << 2, + PlatformWheelEventPhaseChanged = 1 << 3, + PlatformWheelEventPhaseEnded = 1 << 4, + PlatformWheelEventPhaseCancelled = 1 << 5, + }; +#endif + class PlatformWheelEvent { public: PlatformWheelEvent() @@ -83,6 +97,9 @@ namespace WebCore { , m_ctrlKey(false) , m_altKey(false) , m_metaKey(false) +#if PLATFORM(MAC) + , m_phase(PlatformWheelEventPhaseNone) +#endif { } @@ -128,10 +145,14 @@ namespace WebCore { PlatformWheelEvent(const Evas_Event_Mouse_Wheel*); #endif -#if PLATFORM(MAC) && defined(__OBJC__) +#if PLATFORM(MAC) +#if defined(__OBJC__) PlatformWheelEvent(NSEvent *, NSView *windowView); #endif + PlatformWheelEventPhase phase() const { return m_phase; } +#endif + #if PLATFORM(QT) PlatformWheelEvent(QWheelEvent*); PlatformWheelEvent(QGraphicsSceneWheelEvent*); @@ -164,6 +185,9 @@ namespace WebCore { bool m_ctrlKey; bool m_altKey; bool m_metaKey; +#if PLATFORM(MAC) + PlatformWheelEventPhase m_phase; +#endif }; } // namespace WebCore diff --git a/Source/WebCore/platform/SchemeRegistry.cpp b/Source/WebCore/platform/SchemeRegistry.cpp index 58df51a..71697cb 100644 --- a/Source/WebCore/platform/SchemeRegistry.cpp +++ b/Source/WebCore/platform/SchemeRegistry.cpp @@ -45,6 +45,12 @@ static URLSchemesMap& localURLSchemes() return localSchemes; } +static URLSchemesMap& displayIsolatedURLSchemes() +{ + DEFINE_STATIC_LOCAL(URLSchemesMap, displayIsolatedSchemes, ()); + return displayIsolatedSchemes; +} + static URLSchemesMap& secureSchemes() { DEFINE_STATIC_LOCAL(URLSchemesMap, secureSchemes, ()); @@ -82,7 +88,7 @@ static URLSchemesMap& emptyDocumentSchemes() void SchemeRegistry::registerURLSchemeAsLocal(const String& scheme) { - WebCore::localURLSchemes().add(scheme); + localURLSchemes().add(scheme); } void SchemeRegistry::removeURLSchemeRegisteredAsLocal(const String& scheme) @@ -93,50 +99,19 @@ void SchemeRegistry::removeURLSchemeRegisteredAsLocal(const String& scheme) if (scheme == "applewebdata") return; #endif - WebCore::localURLSchemes().remove(scheme); -} - -const URLSchemesMap& SchemeRegistry::localURLSchemes() -{ - return WebCore::localURLSchemes(); + localURLSchemes().remove(scheme); } -bool SchemeRegistry::shouldTreatURLAsLocal(const String& url) +const URLSchemesMap& SchemeRegistry::localSchemes() { - // This avoids an allocation of another String and the HashSet contains() - // call for the file: and http: schemes. - if (url.length() >= 5) { - const UChar* s = url.characters(); - if (s[0] == 'h' && s[1] == 't' && s[2] == 't' && s[3] == 'p' && s[4] == ':') - return false; - if (s[0] == 'f' && s[1] == 'i' && s[2] == 'l' && s[3] == 'e' && s[4] == ':') - return true; - } - - size_t loc = url.find(':'); - if (loc == notFound) - return false; - - String scheme = url.left(loc); - return WebCore::localURLSchemes().contains(scheme); + return localURLSchemes(); } bool SchemeRegistry::shouldTreatURLSchemeAsLocal(const String& scheme) { - // This avoids an allocation of another String and the HashSet contains() - // call for the file: and http: schemes. - if (scheme.length() == 4) { - const UChar* s = scheme.characters(); - if (s[0] == 'h' && s[1] == 't' && s[2] == 't' && s[3] == 'p') - return false; - if (s[0] == 'f' && s[1] == 'i' && s[2] == 'l' && s[3] == 'e') - return true; - } - if (scheme.isEmpty()) return false; - - return WebCore::localURLSchemes().contains(scheme); + return localURLSchemes().contains(scheme); } void SchemeRegistry::registerURLSchemeAsNoAccess(const String& scheme) @@ -149,6 +124,16 @@ bool SchemeRegistry::shouldTreatURLSchemeAsNoAccess(const String& scheme) return schemesWithUniqueOrigins().contains(scheme); } +void SchemeRegistry::registerURLSchemeAsDisplayIsolated(const String& scheme) +{ + displayIsolatedURLSchemes().add(scheme); +} + +bool SchemeRegistry::shouldTreatURLSchemeAsDisplayIsolated(const String& scheme) +{ + return displayIsolatedURLSchemes().contains(scheme); +} + void SchemeRegistry::registerURLSchemeAsSecure(const String& scheme) { secureSchemes().add(scheme); diff --git a/Source/WebCore/platform/SchemeRegistry.h b/Source/WebCore/platform/SchemeRegistry.h index 56e3b33..530fcab 100644 --- a/Source/WebCore/platform/SchemeRegistry.h +++ b/Source/WebCore/platform/SchemeRegistry.h @@ -38,9 +38,8 @@ class SchemeRegistry { public: static void registerURLSchemeAsLocal(const String&); static void removeURLSchemeRegisteredAsLocal(const String&); - static const URLSchemesMap& localURLSchemes(); + static const URLSchemesMap& localSchemes(); - static bool shouldTreatURLAsLocal(const String&); static bool shouldTreatURLSchemeAsLocal(const String&); // Secure schemes do not trigger mixed content warnings. For example, @@ -51,7 +50,12 @@ public: static void registerURLSchemeAsNoAccess(const String&); static bool shouldTreatURLSchemeAsNoAccess(const String&); - + + // Display-isolated schemes can only be displayed (in the sense of + // SecurityOrigin::canDisplay) by documents from the same scheme. + static void registerURLSchemeAsDisplayIsolated(const String&); + static bool shouldTreatURLSchemeAsDisplayIsolated(const String&); + static void registerURLSchemeAsEmptyDocument(const String&); static bool shouldLoadURLSchemeAsEmptyDocument(const String&); }; diff --git a/Source/WebCore/platform/UUID.cpp b/Source/WebCore/platform/UUID.cpp index 5c2e076..c072f4a 100644 --- a/Source/WebCore/platform/UUID.cpp +++ b/Source/WebCore/platform/UUID.cpp @@ -39,11 +39,11 @@ #if OS(WINDOWS) #include -#elif OS(DARWIN) +#elif OS(DARWIN) && PLATFORM(CF) #include #elif OS(LINUX) && !PLATFORM(CHROMIUM) #include -#elif OS(LINUX) && PLATFORM(CHROMIUM) +#elif (OS(LINUX) && PLATFORM(CHROMIUM)) || (OS(DARWIN) && !PLATFORM(CF)) #include #include #endif @@ -71,7 +71,7 @@ String createCanonicalUUIDString() String canonicalUuidStr = String(uuidStr + 1, num - 3).lower(); // remove opening and closing bracket and make it lower. ASSERT(canonicalUuidStr[uuidVersionIdentifierIndex] == uuidVersionRequired); return canonicalUuidStr; -#elif OS(DARWIN) +#elif OS(DARWIN) && PLATFORM(CF) CFUUIDRef uuid = CFUUIDCreate(0); CFStringRef uuidStrRef = CFUUIDCreateString(0, uuid); String uuidStr(uuidStrRef); @@ -93,7 +93,7 @@ String createCanonicalUUIDString() String canonicalUuidStr = String(uuidStr).lower(); // make it lower. ASSERT(canonicalUuidStr[uuidVersionIdentifierIndex] == uuidVersionRequired); return canonicalUuidStr; -#elif OS(LINUX) && PLATFORM(CHROMIUM) +#elif (OS(LINUX) && PLATFORM(CHROMIUM)) || (OS(DARWIN) && !PLATFORM(CF)) unsigned randomData[4]; for (size_t i = 0; i < WTF_ARRAY_LENGTH(randomData); ++i) randomData[i] = static_cast(randomNumber() * (std::numeric_limits::max() + 1.0)); diff --git a/Source/WebCore/platform/Widget.cpp b/Source/WebCore/platform/Widget.cpp index 77560ff..9a980c0 100644 --- a/Source/WebCore/platform/Widget.cpp +++ b/Source/WebCore/platform/Widget.cpp @@ -106,6 +106,10 @@ IntPoint Widget::convertToContainingWindow(const IntPoint& localPoint) const } #if !PLATFORM(MAC) +void Widget::setBoundsSize(const IntSize&) +{ +} + IntRect Widget::convertFromRootToContainingWindow(const Widget*, const IntRect& rect) { return rect; diff --git a/Source/WebCore/platform/Widget.h b/Source/WebCore/platform/Widget.h index 2b3a1a6..a6562ef 100644 --- a/Source/WebCore/platform/Widget.h +++ b/Source/WebCore/platform/Widget.h @@ -158,6 +158,7 @@ public: IntPoint pos() const { return frameRect().location(); } virtual void setFrameRect(const IntRect&); + virtual void setBoundsSize(const IntSize&); virtual IntRect frameRect() const; IntRect boundsRect() const { return IntRect(0, 0, width(), height()); } diff --git a/Source/WebCore/platform/android/DragDataAndroid.cpp b/Source/WebCore/platform/android/DragDataAndroid.cpp index 4e99b2c..2c341b0 100644 --- a/Source/WebCore/platform/android/DragDataAndroid.cpp +++ b/Source/WebCore/platform/android/DragDataAndroid.cpp @@ -47,7 +47,7 @@ bool DragData::containsPlainText() const return false; } -String DragData::asPlainText() const +String DragData::asPlainText(Frame*) const { return String(); } @@ -62,18 +62,18 @@ bool DragData::containsCompatibleContent() const return false; } -bool DragData::containsURL(FilenameConversionPolicy) const +bool DragData::containsURL(Frame*, FilenameConversionPolicy) const { return false; } -String DragData::asURL(FilenameConversionPolicy, String*) const +String DragData::asURL(Frame*, FilenameConversionPolicy, String*) const { return String(); } -PassRefPtr DragData::asFragment(Document*) const +PassRefPtr DragData::asFragment(Frame*, PassRefPtr, bool, bool&) const { return 0; } diff --git a/Source/WebCore/platform/chromium/ChromiumBridge.h b/Source/WebCore/platform/chromium/ChromiumBridge.h index 56969ef..d3b8528 100644 --- a/Source/WebCore/platform/chromium/ChromiumBridge.h +++ b/Source/WebCore/platform/chromium/ChromiumBridge.h @@ -159,10 +159,6 @@ namespace WebCore { // Forms -------------------------------------------------------------- static void notifyFormStateChanged(const Document*); -#if !ENABLE(CLIENT_BASED_GEOLOCATION) - // Geolocation -------------------------------------------------------- - static GeolocationServiceBridge* createGeolocationServiceBridge(GeolocationServiceChromium*); -#endif // Databases ---------------------------------------------------------- // Returns a handle to the DB file and ooptionally a handle to its containing directory static PlatformFileHandle databaseOpenFile(const String& vfsFleName, int desiredFlags); diff --git a/Source/WebCore/platform/chromium/ClipboardUtilitiesChromium.h b/Source/WebCore/platform/chromium/ClipboardUtilitiesChromium.h index 9fdad42..3e6f92a 100644 --- a/Source/WebCore/platform/chromium/ClipboardUtilitiesChromium.h +++ b/Source/WebCore/platform/chromium/ClipboardUtilitiesChromium.h @@ -28,6 +28,9 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +#ifndef ClipboardUtilitiesChromium_h +#define ClipboardUtilitiesChromium_h + #include namespace WebCore { @@ -40,3 +43,5 @@ void replaceNewlinesWithWindowsStyleNewlines(String&); void replaceNBSPWithSpace(String&); } // namespace WebCore + +#endif // ClipboardUtilitiesChromium_h diff --git a/Source/WebCore/platform/chromium/DragDataChromium.cpp b/Source/WebCore/platform/chromium/DragDataChromium.cpp index 2b04523..8c20a00 100644 --- a/Source/WebCore/platform/chromium/DragDataChromium.cpp +++ b/Source/WebCore/platform/chromium/DragDataChromium.cpp @@ -35,6 +35,7 @@ #include "ClipboardMimeTypes.h" #include "DocumentFragment.h" #include "FileSystem.h" +#include "Frame.h" #include "KURL.h" #include "markup.h" #include "NotImplemented.h" @@ -47,13 +48,13 @@ static bool containsHTML(const ChromiumDataObject* dropData) return dropData->types().contains(mimeTypeTextHTML); } -bool DragData::containsURL(FilenameConversionPolicy filenamePolicy) const +bool DragData::containsURL(Frame*, FilenameConversionPolicy filenamePolicy) const { return m_platformDragData->types().contains(mimeTypeURL) || (filenamePolicy == ConvertFilenames && m_platformDragData->containsFilenames()); } -String DragData::asURL(FilenameConversionPolicy filenamePolicy, String* title) const +String DragData::asURL(Frame*, FilenameConversionPolicy filenamePolicy, String* title) const { String url; if (m_platformDragData->types().contains(mimeTypeURL)) { @@ -84,7 +85,7 @@ bool DragData::containsPlainText() const return m_platformDragData->types().contains(mimeTypeTextPlain); } -String DragData::asPlainText() const +String DragData::asPlainText(Frame*) const { bool ignoredSuccess; return m_platformDragData->getData(mimeTypeTextPlain, ignoredSuccess); @@ -109,13 +110,13 @@ bool DragData::canSmartReplace() const bool DragData::containsCompatibleContent() const { return containsPlainText() - || containsURL() + || containsURL(0) || containsHTML(m_platformDragData) || containsColor() || containsFiles(); } -PassRefPtr DragData::asFragment(Document* doc) const +PassRefPtr DragData::asFragment(Frame* frame, PassRefPtr, bool, bool&) const { /* * Order is richest format first. On OSX this is: @@ -137,7 +138,7 @@ PassRefPtr DragData::asFragment(Document* doc) const if (m_platformDragData->types().contains(mimeTypeTextHTML)) { bool ignoredSuccess; - RefPtr fragment = createFragmentFromMarkup(doc, + RefPtr fragment = createFragmentFromMarkup(frame->document(), m_platformDragData->getData(mimeTypeTextHTML, ignoredSuccess), m_platformDragData->htmlBaseUrl(), FragmentScriptingNotAllowed); return fragment.release(); } diff --git a/Source/WebCore/platform/chromium/GeolocationServiceChromium.cpp b/Source/WebCore/platform/chromium/GeolocationServiceChromium.cpp deleted file mode 100644 index c5e73ae..0000000 --- a/Source/WebCore/platform/chromium/GeolocationServiceChromium.cpp +++ /dev/null @@ -1,114 +0,0 @@ -/* - * Copyright (c) 2010, Google Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Google Inc. nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "config.h" -#include "GeolocationServiceChromium.h" - -#include "ChromiumBridge.h" - -#if ENABLE(CLIENT_BASED_GEOLOCATION) -#error "This file should not be compiled when ENABLE(CLIENT_BASED_GEOLOCATION)" -#endif // ENABLE(CLIENT_BASED_GEOLOCATION) - -namespace WebCore { - -GeolocationServiceBridge::~GeolocationServiceBridge() -{ -} - -GeolocationServiceChromium::GeolocationServiceChromium(GeolocationServiceClient* c) - : GeolocationService(c), - m_geolocation(static_cast(c)), - m_geolocationServiceBridge(ChromiumBridge::createGeolocationServiceBridge(this)), - m_lastError(PositionError::create(PositionError::POSITION_UNAVAILABLE, "")) -{ -} - -void GeolocationServiceChromium::setIsAllowed(bool allowed) -{ - m_geolocation->setIsAllowed(allowed); -} - -void GeolocationServiceChromium::setLastPosition(PassRefPtr geoposition) -{ - m_lastPosition = geoposition; - positionChanged(); -} - -void GeolocationServiceChromium::setLastError(int errorCode, const String& message) -{ - m_lastError = PositionError::create(static_cast(errorCode), message); - errorOccurred(); -} - -Frame* GeolocationServiceChromium::frame() -{ - return m_geolocation->frame(); -} - -bool GeolocationServiceChromium::startUpdating(PositionOptions* options) -{ - return m_geolocationServiceBridge->startUpdating(options); -} - -void GeolocationServiceChromium::stopUpdating() -{ - return m_geolocationServiceBridge->stopUpdating(); -} - -void GeolocationServiceChromium::suspend() -{ - return m_geolocationServiceBridge->suspend(); -} - -void GeolocationServiceChromium::resume() -{ - return m_geolocationServiceBridge->resume(); -} - -Geoposition* GeolocationServiceChromium::lastPosition() const -{ - return m_lastPosition.get(); -} - -PositionError* GeolocationServiceChromium::lastError() const -{ - return m_lastError.get(); -} - -static GeolocationService* createGeolocationServiceChromium(GeolocationServiceClient* c) -{ - return new GeolocationServiceChromium(c); -} - -// Sets up the factory function for GeolocationService. -GeolocationService::FactoryFunction* GeolocationService::s_factoryFunction = &createGeolocationServiceChromium; - -} // namespace WebCore diff --git a/Source/WebCore/platform/chromium/GeolocationServiceChromium.h b/Source/WebCore/platform/chromium/GeolocationServiceChromium.h deleted file mode 100644 index 7e6f633..0000000 --- a/Source/WebCore/platform/chromium/GeolocationServiceChromium.h +++ /dev/null @@ -1,87 +0,0 @@ -/* - * Copyright (c) 2010, Google Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Google Inc. nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef GeolocationServiceChromium_h -#define GeolocationServiceChromium_h - -#include "Geolocation.h" -#include "GeolocationService.h" -#include "Geoposition.h" -#include "PlatformString.h" -#include "PositionError.h" - -namespace WebCore { - -// Provides an interface for GeolocationServiceChromium to call into the embedder. -class GeolocationServiceBridge { -public: - virtual ~GeolocationServiceBridge(); - // Called by GeolocationServiceChromium. - virtual bool startUpdating(PositionOptions*) = 0; - virtual void stopUpdating() = 0; - virtual void suspend() = 0; - virtual void resume() = 0; - - // Called by the embedder, to identify this bridge. - virtual int getBridgeId() const = 0; - virtual void attachBridgeIfNeeded() = 0; -}; - -// This class extends GeolocationService, and uses GeolocationServiceBridge to -// call into the embedder, as well as provides a few extra methods so that the -// embedder can notify permission, position, error, etc. -class GeolocationServiceChromium : public GeolocationService { -public: - explicit GeolocationServiceChromium(GeolocationServiceClient*); - - GeolocationServiceBridge* geolocationServiceBridge() const { return m_geolocationServiceBridge.get(); } - void setIsAllowed(bool allowed); - void setLastPosition(PassRefPtr); - void setLastError(int errorCode, const String& message); - Frame* frame(); - - // From GeolocationService. - virtual bool startUpdating(PositionOptions*); - virtual void stopUpdating(); - virtual void suspend(); - virtual void resume(); - virtual Geoposition* lastPosition() const; - virtual PositionError* lastError() const; - -private: - Geolocation* m_geolocation; - OwnPtr m_geolocationServiceBridge; - RefPtr m_lastPosition; - RefPtr m_lastError; -}; - -} // namespace WebCore - -#endif // GeolocationServiceChromium_h diff --git a/Source/WebCore/platform/chromium/PopupMenuChromium.cpp b/Source/WebCore/platform/chromium/PopupMenuChromium.cpp index 04eeb93..bb45e79 100644 --- a/Source/WebCore/platform/chromium/PopupMenuChromium.cpp +++ b/Source/WebCore/platform/chromium/PopupMenuChromium.cpp @@ -329,11 +329,8 @@ PopupContainer::~PopupContainer() removeChild(m_listBox.get()); } -void PopupContainer::showPopup(FrameView* view) +IntRect PopupContainer::layoutAndCalculateWidgetRect(int targetControlHeight, const IntPoint& popupInitialCoordinate) { - // Pre-layout, our size matches the element. + Node* input = o->node()->shadowAncestorNode(); + if (!input->renderer()->isBox()) + return false; + RenderBox* inputRenderBox = toRenderBox(input->renderer()); + IntRect inputContentBox = inputRenderBox->contentBoxRect(); + + // Make sure the scaled button stays square and will fit in its parent's box. + int cancelButtonSize = qMin(inputContentBox.width(), qMin(inputContentBox.height(), r.height())); + // Calculate cancel button's coordinates relative to the input element. + // Center the button vertically. Round up though, so if it has to be one pixel off-center, it will + // be one pixel closer to the bottom of the field. This tends to look better with the text. + IntRect cancelButtonRect(o->offsetFromAncestorContainer(inputRenderBox).width(), + inputContentBox.y() + (inputContentBox.height() - cancelButtonSize + 1) / 2, + cancelButtonSize, cancelButtonSize); + IntRect paintingRect = convertToPaintingRect(inputRenderBox, o, cancelButtonRect, r); + static Image* cancelImage = Image::loadPlatformResource("searchCancelButton").releaseRef(); + static Image* cancelPressedImage = Image::loadPlatformResource("searchCancelButtonPressed").releaseRef(); + pi.context->drawImage(isPressed(o) ? cancelPressedImage : cancelImage, + o->style()->colorSpace(), paintingRect); + return false; } void RenderThemeQt::adjustSearchFieldDecorationStyle(CSSStyleSelector* selector, RenderStyle* style, @@ -1037,7 +1114,12 @@ ControlPart RenderThemeQt::initializeCommonQStyleOptions(QStyleOption& option, R String RenderThemeQt::extraMediaControlsStyleSheet() { - return String(mediaControlsQtUserAgentStyleSheet, sizeof(mediaControlsQtUserAgentStyleSheet)); + String result = String(mediaControlsQtUserAgentStyleSheet, sizeof(mediaControlsQtUserAgentStyleSheet)); + + if (m_page && m_page->chrome()->requiresFullscreenForVideoPlayback()) + result += String(mediaControlsQtFullscreenUserAgentStyleSheet, sizeof(mediaControlsQtFullscreenUserAgentStyleSheet)); + + return result; } // Helper class to transform the painter's world matrix to the object's content area, scaled to 0,0,100,100 diff --git a/Source/WebCore/platform/qt/RenderThemeQt.h b/Source/WebCore/platform/qt/RenderThemeQt.h index c28168a..6981641 100644 --- a/Source/WebCore/platform/qt/RenderThemeQt.h +++ b/Source/WebCore/platform/qt/RenderThemeQt.h @@ -81,8 +81,8 @@ public: virtual double caretBlinkInterval() const; -#if USE(QT_MOBILE_THEME) virtual bool isControlStyled(const RenderStyle*, const BorderData&, const FillLayer&, const Color& backgroundColor) const; +#if USE(QT_MOBILE_THEME) virtual int popupInternalPaddingBottom(RenderStyle*) const; #endif @@ -180,6 +180,8 @@ private: QStyle* fallbackStyle() const; + IntRect convertToPaintingRect(RenderObject* inputRenderer, const RenderObject* partRenderer, IntRect partRect, const IntRect& localOffset) const; + Page* m_page; #ifdef Q_WS_MAC diff --git a/Source/WebCore/platform/qt/WheelEventQt.cpp b/Source/WebCore/platform/qt/WheelEventQt.cpp index 57a7ebc..aa61d91 100644 --- a/Source/WebCore/platform/qt/WheelEventQt.cpp +++ b/Source/WebCore/platform/qt/WheelEventQt.cpp @@ -48,10 +48,10 @@ void PlatformWheelEvent::applyDelta(int delta, Qt::Orientation orientation) m_wheelTicksX = m_deltaX; m_wheelTicksY = m_deltaY; +#ifndef QT_NO_WHEELEVENT // Use the same single scroll step as QTextEdit // (in QTextEditPrivate::init [h,v]bar->setSingleStep) static const float cDefaultQtScrollStep = 20.f; -#ifndef QT_NO_WHEELEVENT m_deltaX *= (fullTick) ? QApplication::wheelScrollLines() * cDefaultQtScrollStep : 1; m_deltaY *= (fullTick) ? QApplication::wheelScrollLines() * cDefaultQtScrollStep : 1; #endif diff --git a/Source/WebCore/platform/win/DragDataWin.cpp b/Source/WebCore/platform/win/DragDataWin.cpp index 56345e2..906119d 100644 --- a/Source/WebCore/platform/win/DragDataWin.cpp +++ b/Source/WebCore/platform/win/DragDataWin.cpp @@ -27,6 +27,7 @@ #include "DragData.h" #include "ClipboardUtilitiesWin.h" +#include "Frame.h" #include "DocumentFragment.h" #include "PlatformString.h" #include "Markup.h" @@ -37,7 +38,7 @@ namespace WebCore { -bool DragData::containsURL(FilenameConversionPolicy filenamePolicy) const +bool DragData::containsURL(Frame*, FilenameConversionPolicy filenamePolicy) const { return SUCCEEDED(m_platformDragData->QueryGetData(urlWFormat())) || SUCCEEDED(m_platformDragData->QueryGetData(urlFormat())) @@ -46,7 +47,7 @@ bool DragData::containsURL(FilenameConversionPolicy filenamePolicy) const || SUCCEEDED(m_platformDragData->QueryGetData(filenameFormat())))); } -String DragData::asURL(FilenameConversionPolicy filenamePolicy, String* title) const +String DragData::asURL(Frame*, FilenameConversionPolicy filenamePolicy, String* title) const { bool success; return getURL(m_platformDragData, filenamePolicy, success, title); @@ -89,7 +90,7 @@ bool DragData::containsPlainText() const || SUCCEEDED(m_platformDragData->QueryGetData(plainTextFormat())); } -String DragData::asPlainText() const +String DragData::asPlainText(Frame*) const { bool success; return getPlainText(m_platformDragData, success); @@ -107,13 +108,13 @@ bool DragData::canSmartReplace() const bool DragData::containsCompatibleContent() const { - return containsPlainText() || containsURL() + return containsPlainText() || containsURL(0) || containsHTML(m_platformDragData) || containsFilenames(m_platformDragData) || containsColor(); } -PassRefPtr DragData::asFragment(Document* doc) const +PassRefPtr DragData::asFragment(Frame* frame, PassRefPtr, bool, bool&) const { /* * Order is richest format first. On OSX this is: @@ -126,11 +127,11 @@ PassRefPtr DragData::asFragment(Document* doc) const */ if (containsFilenames(m_platformDragData)) - if (PassRefPtr fragment = fragmentFromFilenames(doc, m_platformDragData)) + if (PassRefPtr fragment = fragmentFromFilenames(frame->document(), m_platformDragData)) return fragment; if (containsHTML(m_platformDragData)) - if (PassRefPtr fragment = fragmentFromHTML(doc, m_platformDragData)) + if (PassRefPtr fragment = fragmentFromHTML(frame->document(), m_platformDragData)) return fragment; return 0; diff --git a/Source/WebCore/platform/win/WebCoreTextRenderer.h b/Source/WebCore/platform/win/WebCoreTextRenderer.h index 7efc1f3..6deef4a 100644 --- a/Source/WebCore/platform/win/WebCoreTextRenderer.h +++ b/Source/WebCore/platform/win/WebCoreTextRenderer.h @@ -23,6 +23,9 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +#ifndef WebCoreTextRenderer_h +#define WebCoreTextRenderer_h + #include namespace WebCore { @@ -43,3 +46,5 @@ namespace WebCore { bool WebCoreAlwaysUsesComplexTextCodePath(); } // namespace WebCore + +#endif // WebCoreTextRenderer_h diff --git a/Source/WebCore/platform/wince/DragDataWinCE.cpp b/Source/WebCore/platform/wince/DragDataWinCE.cpp index 5535ea9..8f531c7 100644 --- a/Source/WebCore/platform/wince/DragDataWinCE.cpp +++ b/Source/WebCore/platform/wince/DragDataWinCE.cpp @@ -23,15 +23,16 @@ #include "DocumentFragment.h" #include "PlatformString.h" +#include "Range.h" namespace WebCore { -bool DragData::containsURL(FilenameConversionPolicy filenamePolicy) const +bool DragData::containsURL(Frame*, FilenameConversionPolicy filenamePolicy) const { return false; } -String DragData::asURL(FilenameConversionPolicy filenamePolicy, String* title) const +String DragData::asURL(Frame*, FilenameConversionPolicy filenamePolicy, String* title) const { return String(); } @@ -50,7 +51,7 @@ bool DragData::containsPlainText() const return false; } -String DragData::asPlainText() const +String DragData::asPlainText(Frame*) const { return String(); } @@ -70,7 +71,7 @@ bool DragData::containsCompatibleContent() const return false; } -PassRefPtr DragData::asFragment(Document* doc) const +PassRefPtr DragData::asFragment(Frame* frame, PassRefPtr, bool, bool&) const { return 0; } diff --git a/Source/WebCore/platform/wx/DragDataWx.cpp b/Source/WebCore/platform/wx/DragDataWx.cpp index 35e3753..53b4219 100644 --- a/Source/WebCore/platform/wx/DragDataWx.cpp +++ b/Source/WebCore/platform/wx/DragDataWx.cpp @@ -55,7 +55,7 @@ bool DragData::containsPlainText() const return false; } -String DragData::asPlainText() const +String DragData::asPlainText(Frame*) const { return String(); } @@ -70,18 +70,18 @@ bool DragData::containsCompatibleContent() const return false; } -bool DragData::containsURL(FilenameConversionPolicy filenamePolicy) const +bool DragData::containsURL(Frame*, FilenameConversionPolicy filenamePolicy) const { return false; } -String DragData::asURL(FilenameConversionPolicy filenamePolicy, String* title) const +String DragData::asURL(Frame*, FilenameConversionPolicy filenamePolicy, String* title) const { return String(); } -PassRefPtr DragData::asFragment(Document*) const +PassRefPtr DragData::asFragment(Frame*, PassRefPtr, bool, bool&) const { return 0; } diff --git a/Source/WebCore/platform/wx/WidgetWx.cpp b/Source/WebCore/platform/wx/WidgetWx.cpp index 9de4c3d..7591a5b 100644 --- a/Source/WebCore/platform/wx/WidgetWx.cpp +++ b/Source/WebCore/platform/wx/WidgetWx.cpp @@ -80,6 +80,10 @@ IntRect Widget::frameRect() const void Widget::setFrameRect(const IntRect& rect) { + // Take a reference to this Widget, because calling functions of the PlatformWidget can invoke arbitrary + // code, which can deref it. + RefPtr protectedThis(this); + if (PlatformWidget widget = platformWidget()) widget->SetSize(rect); -- cgit v1.1