summaryrefslogtreecommitdiffstats
path: root/WebCore/platform/win
diff options
context:
space:
mode:
Diffstat (limited to 'WebCore/platform/win')
-rw-r--r--WebCore/platform/win/ClipboardUtilitiesWin.cpp4
-rw-r--r--WebCore/platform/win/ClipboardWin.cpp12
-rw-r--r--WebCore/platform/win/CursorWin.cpp5
-rw-r--r--WebCore/platform/win/EventLoopWin.cpp2
-rw-r--r--WebCore/platform/win/FileSystemWin.cpp1
-rw-r--r--WebCore/platform/win/PlatformMouseEventWin.cpp4
-rw-r--r--WebCore/platform/win/PlatformScreenWin.cpp5
-rw-r--r--WebCore/platform/win/PopupMenuWin.cpp24
-rw-r--r--WebCore/platform/win/SharedBufferWin.cpp2
-rw-r--r--WebCore/platform/win/SystemInfo.cpp2
-rw-r--r--WebCore/platform/win/SystemTimeWin.cpp2
-rw-r--r--WebCore/platform/win/WidgetWin.cpp1
12 files changed, 39 insertions, 25 deletions
diff --git a/WebCore/platform/win/ClipboardUtilitiesWin.cpp b/WebCore/platform/win/ClipboardUtilitiesWin.cpp
index 0358b7a..f22fcdc 100644
--- a/WebCore/platform/win/ClipboardUtilitiesWin.cpp
+++ b/WebCore/platform/win/ClipboardUtilitiesWin.cpp
@@ -415,7 +415,7 @@ PassRefPtr<DocumentFragment> fragmentFromCF_HTML(Document* doc, const String& cf
unsigned fragmentEnd = cf_html.reverseFind('<', tagEnd);
String markup = cf_html.substring(fragmentStart, fragmentEnd - fragmentStart).stripWhiteSpace();
- return createFragmentFromMarkup(doc, markup, srcURL);
+ return createFragmentFromMarkup(doc, markup, srcURL, FragmentScriptingNotAllowed);
}
@@ -443,7 +443,7 @@ PassRefPtr<DocumentFragment> fragmentFromHTML(Document* doc, IDataObject* data)
html = String(data);
GlobalUnlock(store.hGlobal);
ReleaseStgMedium(&store);
- return createFragmentFromMarkup(doc, html, srcURL);
+ return createFragmentFromMarkup(doc, html, srcURL, FragmentScriptingNotAllowed);
}
return 0;
diff --git a/WebCore/platform/win/ClipboardWin.cpp b/WebCore/platform/win/ClipboardWin.cpp
index b75ce46..f83927d 100644
--- a/WebCore/platform/win/ClipboardWin.cpp
+++ b/WebCore/platform/win/ClipboardWin.cpp
@@ -534,7 +534,7 @@ bool ClipboardWin::setData(const String& type, const String& data)
return false;
}
-static void addMimeTypesForFormat(HashSet<String>& results, FORMATETC& format)
+static void addMimeTypesForFormat(HashSet<String>& results, const FORMATETC& format)
{
// URL and Text are provided for compatibility with IE's model
if (format.cfFormat == urlFormat()->cfFormat || format.cfFormat == urlWFormat()->cfFormat) {
@@ -560,7 +560,7 @@ HashSet<String> ClipboardWin::types() const
COMPtr<IEnumFORMATETC> itr;
- if (FAILED(m_dataObject->EnumFormatEtc(0, &itr)))
+ if (FAILED(m_dataObject->EnumFormatEtc(DATADIR_GET, &itr)))
return results;
if (!itr)
@@ -568,7 +568,8 @@ HashSet<String> ClipboardWin::types() const
FORMATETC data;
- while (SUCCEEDED(itr->Next(1, &data, 0))) {
+ // IEnumFORMATETC::Next returns S_FALSE if there are no more items.
+ while (itr->Next(1, &data, 0) == S_OK) {
addMimeTypesForFormat(results, data);
}
@@ -781,7 +782,7 @@ bool ClipboardWin::hasData()
return false;
COMPtr<IEnumFORMATETC> itr;
- if (FAILED(m_dataObject->EnumFormatEtc(0, &itr)))
+ if (FAILED(m_dataObject->EnumFormatEtc(DATADIR_GET, &itr)))
return false;
if (!itr)
@@ -789,7 +790,8 @@ bool ClipboardWin::hasData()
FORMATETC data;
- if (SUCCEEDED(itr->Next(1, &data, 0))) {
+ // IEnumFORMATETC::Next returns S_FALSE if there are no more items.
+ if (itr->Next(1, &data, 0) == S_OK) {
// There is at least one item in the IDataObject
return true;
}
diff --git a/WebCore/platform/win/CursorWin.cpp b/WebCore/platform/win/CursorWin.cpp
index 5afb1ae9..48cf10b 100644
--- a/WebCore/platform/win/CursorWin.cpp
+++ b/WebCore/platform/win/CursorWin.cpp
@@ -408,4 +408,9 @@ const Cursor& grabbingCursor()
return pointerCursor();
}
+SharedCursor::~SharedCursor()
+{
+ DestroyIcon(m_nativeCursor);
+}
+
}
diff --git a/WebCore/platform/win/EventLoopWin.cpp b/WebCore/platform/win/EventLoopWin.cpp
index aae107d..ece320f 100644
--- a/WebCore/platform/win/EventLoopWin.cpp
+++ b/WebCore/platform/win/EventLoopWin.cpp
@@ -26,6 +26,8 @@
#include "config.h"
#include "EventLoop.h"
+#include <windows.h>
+
namespace WebCore {
void EventLoop::cycle()
diff --git a/WebCore/platform/win/FileSystemWin.cpp b/WebCore/platform/win/FileSystemWin.cpp
index a676f87..0592298 100644
--- a/WebCore/platform/win/FileSystemWin.cpp
+++ b/WebCore/platform/win/FileSystemWin.cpp
@@ -33,6 +33,7 @@
#include "CString.h"
#include "NotImplemented.h"
#include "PlatformString.h"
+#include <wtf/HashMap.h>
#include <windows.h>
#include <winbase.h>
diff --git a/WebCore/platform/win/PlatformMouseEventWin.cpp b/WebCore/platform/win/PlatformMouseEventWin.cpp
index dc4dd2f..8b542f9 100644
--- a/WebCore/platform/win/PlatformMouseEventWin.cpp
+++ b/WebCore/platform/win/PlatformMouseEventWin.cpp
@@ -65,7 +65,7 @@ static MouseEventType messageToEventType(UINT message)
case WM_MBUTTONUP:
return MouseEventReleased;
-#if !PLATFORM(WINCE)
+#if !OS(WINCE)
case WM_MOUSELEAVE:
#endif
case WM_MOUSEMOVE:
@@ -108,7 +108,7 @@ PlatformMouseEvent::PlatformMouseEvent(HWND hWnd, UINT message, WPARAM wParam, L
m_button = MiddleButton;
break;
case WM_MOUSEMOVE:
-#if !PLATFORM(WINCE)
+#if !OS(WINCE)
case WM_MOUSELEAVE:
#endif
if (wParam & MK_LBUTTON)
diff --git a/WebCore/platform/win/PlatformScreenWin.cpp b/WebCore/platform/win/PlatformScreenWin.cpp
index 6e0f861..4af9e17 100644
--- a/WebCore/platform/win/PlatformScreenWin.cpp
+++ b/WebCore/platform/win/PlatformScreenWin.cpp
@@ -27,6 +27,7 @@
#include "config.h"
#include "PlatformScreen.h"
+#include "HostWindow.h"
#include "IntRect.h"
#include "FloatRect.h"
#include "Frame.h"
@@ -53,7 +54,7 @@ static DEVMODE deviceInfoForWidget(Widget* widget)
DEVMODE deviceInfo;
deviceInfo.dmSize = sizeof(DEVMODE);
deviceInfo.dmDriverExtra = 0;
-#if PLATFORM(WINCE)
+#if OS(WINCE)
if (!EnumDisplaySettings(0, ENUM_CURRENT_SETTINGS, &deviceInfo))
deviceInfo.dmBitsPerPel = 16;
#else
@@ -79,7 +80,7 @@ int screenDepthPerComponent(Widget* widget)
bool screenIsMonochrome(Widget* widget)
{
-#if PLATFORM(WINCE)
+#if OS(WINCE)
// EnumDisplaySettings doesn't set dmColor in DEVMODE.
return false;
#else
diff --git a/WebCore/platform/win/PopupMenuWin.cpp b/WebCore/platform/win/PopupMenuWin.cpp
index 7d8c8d5..4ba5e30 100644
--- a/WebCore/platform/win/PopupMenuWin.cpp
+++ b/WebCore/platform/win/PopupMenuWin.cpp
@@ -30,6 +30,7 @@
#include "FrameView.h"
#include "GraphicsContext.h"
#include "HTMLNames.h"
+#include "HostWindow.h"
#include "Page.h"
#include "PlatformMouseEvent.h"
#include "PlatformScreen.h"
@@ -41,7 +42,7 @@
#include <tchar.h>
#include <windows.h>
#include <windowsx.h>
-#if PLATFORM(WINCE)
+#if OS(WINCE)
#include <ResDefCE.h>
#define MAKEPOINTS(l) (*((POINTS FAR *)&(l)))
#endif
@@ -151,7 +152,7 @@ void PopupMenu::show(const IntRect& r, FrameView* view, int index)
// Determine whether we should animate our popups
// Note: Must use 'BOOL' and 'FALSE' instead of 'bool' and 'false' to avoid stack corruption with SystemParametersInfo
BOOL shouldAnimate = FALSE;
-#if !PLATFORM(WINCE)
+#if !OS(WINCE)
::SystemParametersInfo(SPI_GETCOMBOBOXANIMATION, 0, &shouldAnimate, 0);
if (shouldAnimate) {
@@ -279,7 +280,6 @@ void PopupMenu::hide()
::PostMessage(m_popup, WM_NULL, 0, 0);
}
-const int endOfLinePadding = 2;
void PopupMenu::calculatePositionAndSize(const IntRect& r, FrameView* v)
{
// r is in absolute document coordinates, but we want to be in screen coordinates
@@ -325,9 +325,7 @@ void PopupMenu::calculatePositionAndSize(const IntRect& r, FrameView* v)
popupWidth += ScrollbarTheme::nativeTheme()->scrollbarThickness(SmallScrollbar);
// Add padding to align the popup text with the <select> text
- // Note: We can't add paddingRight() because that value includes the width
- // of the dropdown button, so we must use our own endOfLinePadding constant.
- popupWidth += max(0, endOfLinePadding - client()->clientInsetRight()) + max(0, client()->clientPaddingLeft() - client()->clientInsetLeft());
+ popupWidth += max(0, client()->clientPaddingRight() - client()->clientInsetRight()) + max(0, client()->clientPaddingLeft() - client()->clientInsetLeft());
// Leave room for the border
popupWidth += 2 * popupWindowBorderWidth;
@@ -578,7 +576,7 @@ void PopupMenu::paint(const IntRect& damageRect, HDC hdc)
}
}
if (!m_bmp) {
-#if PLATFORM(WINCE)
+#if OS(WINCE)
BitmapInfo bitmapInfo(true, clientRect().width(), clientRect().height());
#else
BitmapInfo bitmapInfo = BitmapInfo::createBottomUp(clientRect().size());
@@ -713,7 +711,7 @@ void PopupMenu::registerClass()
if (haveRegisteredWindowClass)
return;
-#if PLATFORM(WINCE)
+#if OS(WINCE)
WNDCLASS wcex;
#else
WNDCLASSEX wcex;
@@ -734,7 +732,7 @@ void PopupMenu::registerClass()
haveRegisteredWindowClass = true;
-#if PLATFORM(WINCE)
+#if OS(WINCE)
RegisterClass(&wcex);
#else
RegisterClassEx(&wcex);
@@ -744,7 +742,7 @@ void PopupMenu::registerClass()
LRESULT CALLBACK PopupMenu::PopupMenuWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
-#if PLATFORM(WINCE)
+#if OS(WINCE)
LONG longPtr = GetWindowLong(hWnd, 0);
#else
LONG_PTR longPtr = GetWindowLongPtr(hWnd, 0);
@@ -757,7 +755,7 @@ LRESULT CALLBACK PopupMenu::PopupMenuWndProc(HWND hWnd, UINT message, WPARAM wPa
LPCREATESTRUCT createStruct = reinterpret_cast<LPCREATESTRUCT>(lParam);
// Associate the PopupMenu with the window.
-#if PLATFORM(WINCE)
+#if OS(WINCE)
::SetWindowLong(hWnd, 0, (LONG)createStruct->lpCreateParams);
#else
::SetWindowLongPtr(hWnd, 0, (LONG_PTR)createStruct->lpCreateParams);
@@ -891,7 +889,7 @@ LRESULT PopupMenu::wndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam
}
BOOL shouldHotTrack = FALSE;
-#if !PLATFORM(WINCE)
+#if !OS(WINCE)
::SystemParametersInfo(SPI_GETHOTTRACKING, 0, &shouldHotTrack, 0);
#endif
@@ -988,7 +986,7 @@ LRESULT PopupMenu::wndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam
lResult = 0;
break;
}
-#if !PLATFORM(WINCE)
+#if !OS(WINCE)
case WM_PRINTCLIENT:
paint(clientRect(), (HDC)wParam);
break;
diff --git a/WebCore/platform/win/SharedBufferWin.cpp b/WebCore/platform/win/SharedBufferWin.cpp
index 1839c99..a95d590 100644
--- a/WebCore/platform/win/SharedBufferWin.cpp
+++ b/WebCore/platform/win/SharedBufferWin.cpp
@@ -57,6 +57,8 @@ PassRefPtr<SharedBuffer> SharedBuffer::createWithContentsOfFile(const String& fi
goto exit;
}
+ result->m_size = result->m_buffer.size();
+
if (fread(result->m_buffer.data(), 1, fileStat.st_size, fileDescriptor) != fileStat.st_size)
LOG_ERROR("Failed to fully read contents of file %s - errno(%i)", filePath.ascii().data(), errno);
diff --git a/WebCore/platform/win/SystemInfo.cpp b/WebCore/platform/win/SystemInfo.cpp
index ba20ddd..f010769 100644
--- a/WebCore/platform/win/SystemInfo.cpp
+++ b/WebCore/platform/win/SystemInfo.cpp
@@ -26,6 +26,8 @@
#include "config.h"
#include "SystemInfo.h"
+#include <windows.h>
+
namespace WebCore {
bool isRunningOnVistaOrLater()
diff --git a/WebCore/platform/win/SystemTimeWin.cpp b/WebCore/platform/win/SystemTimeWin.cpp
index 6ab4c27..8c25c32 100644
--- a/WebCore/platform/win/SystemTimeWin.cpp
+++ b/WebCore/platform/win/SystemTimeWin.cpp
@@ -37,7 +37,7 @@ namespace WebCore {
float userIdleTime()
{
-#if !PLATFORM(WINCE)
+#if !OS(WINCE)
LASTINPUTINFO lastInputInfo = {0};
lastInputInfo.cbSize = sizeof(LASTINPUTINFO);
if (::GetLastInputInfo(&lastInputInfo))
diff --git a/WebCore/platform/win/WidgetWin.cpp b/WebCore/platform/win/WidgetWin.cpp
index 2272027..74a22f6 100644
--- a/WebCore/platform/win/WidgetWin.cpp
+++ b/WebCore/platform/win/WidgetWin.cpp
@@ -26,6 +26,7 @@
#include "config.h"
#include "Widget.h"
+#include "Chrome.h"
#include "Cursor.h"
#include "Document.h"
#include "Element.h"