| Differences between
and this patch
- Source/WebCore/ChangeLog +31 lines
Lines 1-3 Source/WebCore/ChangeLog_sec1
1
2011-03-09  Peter Kasting  <pkasting@google.com>
2
3
        Reviewed by NOBODY (OOPS!).
4
5
        Unify Windows version checks.
6
        https://bugs.webkit.org/show_bug.cgi?id=55979
7
8
        * GNUmakefile.am: Fix spaces -> tabs.
9
        * StringsNotToBeLocalized.txt:
10
        * WebCore.pro: Add SystemInfo.* to Qt build.
11
        * platform/chromium/ScrollbarThemeChromiumWin.cpp:
12
        (WebCore::ScrollbarThemeChromiumWin::invalidateOnMouseEnterExit):
13
        (WebCore::ScrollbarThemeChromiumWin::getThemeState):
14
        (WebCore::ScrollbarThemeChromiumWin::getThemeArrowState):
15
        * platform/graphics/chromium/GlyphPageTreeNodeChromiumWin.cpp:
16
        (WebCore::fillBMPGlyphs):
17
        * platform/win/CursorWin.cpp:
18
        (WebCore::createSharedCursor):
19
        * platform/win/ScrollbarThemeWin.cpp:
20
        (WebCore::ScrollbarThemeWin::ScrollbarThemeWin):
21
        * platform/win/SystemInfo.cpp: Add full-fledged version check and UA string helper function.
22
        (WebCore::windowsVersion):
23
        (WebCore::windowsVersionForUAString):
24
        * platform/win/SystemInfo.h: Add full-fledged version check and UA string helper function.
25
        * rendering/RenderThemeChromiumWin.cpp:
26
        (WebCore::getNonClientMetrics):
27
        * rendering/RenderThemeWin.cpp:
28
        (WebCore::RenderThemeWin::getThemeData):
29
        (WebCore::RenderThemeWin::paintMenuList):
30
        (WebCore::RenderThemeWin::paintMenuListButton):
31
1
2011-03-09  Dan Bernstein  <mitz@apple.com>
32
2011-03-09  Dan Bernstein  <mitz@apple.com>
2
33
3
        Reviewed by Dave Hyatt.
34
        Reviewed by Dave Hyatt.
- Source/WebCore/GNUmakefile.am -2 / +2 lines
Lines 3851-3858 if TARGET_WIN32 Source/WebCore/GNUmakefile.am_sec1
3851
webcore_sources += \
3851
webcore_sources += \
3852
	Source/WebCore/platform/ScrollAnimatorWin.cpp \
3852
	Source/WebCore/platform/ScrollAnimatorWin.cpp \
3853
	Source/WebCore/platform/ScrollAnimatorWin.h \
3853
	Source/WebCore/platform/ScrollAnimatorWin.h \
3854
    Source/WebCore/platform/win/SystemInfo.cpp \
3854
	Source/WebCore/platform/win/SystemInfo.cpp \
3855
    Source/WebCore/platform/win/SystemInfo.h \
3855
	Source/WebCore/platform/win/SystemInfo.h \
3856
	Source/WebCore/plugins/win/PluginDatabaseWin.cpp \
3856
	Source/WebCore/plugins/win/PluginDatabaseWin.cpp \
3857
	Source/WebCore/plugins/win/PluginMessageThrottlerWin.cpp \
3857
	Source/WebCore/plugins/win/PluginMessageThrottlerWin.cpp \
3858
	Source/WebCore/plugins/win/PluginMessageThrottlerWin.h
3858
	Source/WebCore/plugins/win/PluginMessageThrottlerWin.h
- Source/WebCore/StringsNotToBeLocalized.txt +5 lines
Lines 511-519 Source/WebCore/StringsNotToBeLocalized.txt_sec1
511
"WebViewWindowClass"
511
"WebViewWindowClass"
512
"WebWorkersPrivate"
512
"WebWorkersPrivate"
513
"Windows "
513
"Windows "
514
"Windows CE"
515
"Windows CE "
516
"Windows CE .NET"
517
"Windows 3.1"
514
"Windows 95"
518
"Windows 95"
515
"Windows 98"
519
"Windows 98"
516
"Windows 98; Win 9x 4.90"
520
"Windows 98; Win 9x 4.90"
521
"WinNT4.0"
517
"Windows NT "
522
"Windows NT "
518
"WmvPlugin"
523
"WmvPlugin"
519
"XSL"
524
"XSL"
- Source/WebCore/WebCore.pro +2 lines
Lines 2523-2529 contains(DEFINES, ENABLE_SMOOTH_SCROLLIN Source/WebCore/WebCore.pro_sec1
2523
}
2523
}
2524
2524
2525
win32-*|wince* {
2525
win32-*|wince* {
2526
    HEADERS += platform/win/SystemInfo.h
2526
    SOURCES += \
2527
    SOURCES += \
2528
        platform/win/SystemInfo.cpp \
2527
        platform/win/SystemTimeWin.cpp \
2529
        platform/win/SystemTimeWin.cpp \
2528
        platform/graphics/win/TransformationMatrixWin.cpp
2530
        platform/graphics/win/TransformationMatrixWin.cpp
2529
}
2531
}
- Source/WebCore/platform/chromium/ScrollbarThemeChromiumWin.cpp -11 / +11 lines
Lines 70-76 int ScrollbarThemeChromiumWin::scrollbar Source/WebCore/platform/chromium/ScrollbarThemeChromiumWin.cpp_sec1
70
70
71
bool ScrollbarThemeChromiumWin::invalidateOnMouseEnterExit()
71
bool ScrollbarThemeChromiumWin::invalidateOnMouseEnterExit()
72
{
72
{
73
    return isRunningOnVistaOrLater();
73
    return windowsVersion() >= WindowsVista;
74
}
74
}
75
75
76
bool ScrollbarThemeChromiumWin::shouldSnapBackToDragOrigin(Scrollbar* scrollbar, const PlatformMouseEvent& evt)
76
bool ScrollbarThemeChromiumWin::shouldSnapBackToDragOrigin(Scrollbar* scrollbar, const PlatformMouseEvent& evt)
Lines 160-171 int ScrollbarThemeChromiumWin::getThemeS Source/WebCore/platform/chromium/ScrollbarThemeChromiumWin.cpp_sec2
160
    if (scrollbar->pressedPart() == ThumbPart) {
160
    if (scrollbar->pressedPart() == ThumbPart) {
161
        if (part == ThumbPart)
161
        if (part == ThumbPart)
162
            return SCRBS_PRESSED;
162
            return SCRBS_PRESSED;
163
        return isRunningOnVistaOrLater() ? SCRBS_HOVER : SCRBS_NORMAL;
163
        return (windowsVersion() < WindowsVista) ? SCRBS_NORMAL : SCRBS_HOVER;
164
    }
164
    }
165
    if (!scrollbar->enabled())
165
    if (!scrollbar->enabled())
166
        return SCRBS_DISABLED;
166
        return SCRBS_DISABLED;
167
    if (scrollbar->hoveredPart() != part || part == BackTrackPart || part == ForwardTrackPart)
167
    if (scrollbar->hoveredPart() != part || part == BackTrackPart || part == ForwardTrackPart)
168
        return (scrollbar->hoveredPart() == NoPart || !isRunningOnVistaOrLater()) ? SCRBS_NORMAL : SCRBS_HOVER;
168
        return (scrollbar->hoveredPart() == NoPart || (windowsVersion() < WindowsVista)) ? SCRBS_NORMAL : SCRBS_HOVER;
169
    if (scrollbar->pressedPart() == NoPart)
169
    if (scrollbar->pressedPart() == NoPart)
170
        return SCRBS_HOT;
170
        return SCRBS_HOT;
171
    return (scrollbar->pressedPart() == part) ? SCRBS_PRESSED : SCRBS_NORMAL;
171
    return (scrollbar->pressedPart() == part) ? SCRBS_PRESSED : SCRBS_NORMAL;
Lines 179-221 int ScrollbarThemeChromiumWin::getThemeA Source/WebCore/platform/chromium/ScrollbarThemeChromiumWin.cpp_sec3
179
    if (part == BackButtonStartPart || part == ForwardButtonStartPart) {
179
    if (part == BackButtonStartPart || part == ForwardButtonStartPart) {
180
        if (scrollbar->orientation() == HorizontalScrollbar) {
180
        if (scrollbar->orientation() == HorizontalScrollbar) {
181
            if (scrollbar->pressedPart() == ThumbPart)
181
            if (scrollbar->pressedPart() == ThumbPart)
182
                return !isRunningOnVistaOrLater() ? ABS_LEFTNORMAL : ABS_LEFTHOVER;
182
                return (windowsVersion() < WindowsVista) ? ABS_LEFTNORMAL : ABS_LEFTHOVER;
183
            if (!scrollbar->enabled())
183
            if (!scrollbar->enabled())
184
                return ABS_LEFTDISABLED;
184
                return ABS_LEFTDISABLED;
185
            if (scrollbar->hoveredPart() != part)
185
            if (scrollbar->hoveredPart() != part)
186
                return ((scrollbar->hoveredPart() == NoPart) || !isRunningOnVistaOrLater()) ? ABS_LEFTNORMAL : ABS_LEFTHOVER;
186
                return ((scrollbar->hoveredPart() == NoPart) || (windowsVersion() < WindowsVista)) ? ABS_LEFTNORMAL : ABS_LEFTHOVER;
187
            if (scrollbar->pressedPart() == NoPart)
187
            if (scrollbar->pressedPart() == NoPart)
188
                return ABS_LEFTHOT;
188
                return ABS_LEFTHOT;
189
            return (scrollbar->pressedPart() == part) ?
189
            return (scrollbar->pressedPart() == part) ?
190
                ABS_LEFTPRESSED : ABS_LEFTNORMAL;
190
                ABS_LEFTPRESSED : ABS_LEFTNORMAL;
191
        }
191
        }
192
        if (scrollbar->pressedPart() == ThumbPart)
192
        if (scrollbar->pressedPart() == ThumbPart)
193
            return !isRunningOnVistaOrLater() ? ABS_UPNORMAL : ABS_UPHOVER;
193
            return (windowsVersion() < WindowsVista) ? ABS_UPNORMAL : ABS_UPHOVER;
194
        if (!scrollbar->enabled())
194
        if (!scrollbar->enabled())
195
            return ABS_UPDISABLED;
195
            return ABS_UPDISABLED;
196
        if (scrollbar->hoveredPart() != part)
196
        if (scrollbar->hoveredPart() != part)
197
            return ((scrollbar->hoveredPart() == NoPart) || !isRunningOnVistaOrLater()) ? ABS_UPNORMAL : ABS_UPHOVER;
197
            return ((scrollbar->hoveredPart() == NoPart) || (windowsVersion() < WindowsVista)) ? ABS_UPNORMAL : ABS_UPHOVER;
198
        if (scrollbar->pressedPart() == NoPart)
198
        if (scrollbar->pressedPart() == NoPart)
199
            return ABS_UPHOT;
199
            return ABS_UPHOT;
200
        return (scrollbar->pressedPart() == part) ? ABS_UPPRESSED : ABS_UPNORMAL;
200
        return (scrollbar->pressedPart() == part) ? ABS_UPPRESSED : ABS_UPNORMAL;
201
    }
201
    }
202
    if (scrollbar->orientation() == HorizontalScrollbar) {
202
    if (scrollbar->orientation() == HorizontalScrollbar) {
203
        if (scrollbar->pressedPart() == ThumbPart)
203
        if (scrollbar->pressedPart() == ThumbPart)
204
            return !isRunningOnVistaOrLater() ? ABS_RIGHTNORMAL : ABS_RIGHTHOVER;
204
            return (windowsVersion() < WindowsVista) ? ABS_RIGHTNORMAL : ABS_RIGHTHOVER;
205
        if (!scrollbar->enabled())
205
        if (!scrollbar->enabled())
206
            return ABS_RIGHTDISABLED;
206
            return ABS_RIGHTDISABLED;
207
        if (scrollbar->hoveredPart() != part)
207
        if (scrollbar->hoveredPart() != part)
208
            return ((scrollbar->hoveredPart() == NoPart) || !isRunningOnVistaOrLater()) ? ABS_RIGHTNORMAL : ABS_RIGHTHOVER;
208
            return ((scrollbar->hoveredPart() == NoPart) || (windowsVersion() < WindowsVista)) ? ABS_RIGHTNORMAL : ABS_RIGHTHOVER;
209
        if (scrollbar->pressedPart() == NoPart)
209
        if (scrollbar->pressedPart() == NoPart)
210
            return ABS_RIGHTHOT;
210
            return ABS_RIGHTHOT;
211
        return (scrollbar->pressedPart() == part) ? ABS_RIGHTPRESSED : ABS_RIGHTNORMAL;
211
        return (scrollbar->pressedPart() == part) ? ABS_RIGHTPRESSED : ABS_RIGHTNORMAL;
212
    }
212
    }
213
    if (scrollbar->pressedPart() == ThumbPart)
213
    if (scrollbar->pressedPart() == ThumbPart)
214
        return !isRunningOnVistaOrLater() ? ABS_DOWNNORMAL : ABS_DOWNHOVER;
214
        return (windowsVersion() < WindowsVista) ? ABS_DOWNNORMAL : ABS_DOWNHOVER;
215
    if (!scrollbar->enabled())
215
    if (!scrollbar->enabled())
216
        return ABS_DOWNDISABLED;
216
        return ABS_DOWNDISABLED;
217
    if (scrollbar->hoveredPart() != part)
217
    if (scrollbar->hoveredPart() != part)
218
        return ((scrollbar->hoveredPart() == NoPart) || !isRunningOnVistaOrLater()) ? ABS_DOWNNORMAL : ABS_DOWNHOVER;
218
        return ((scrollbar->hoveredPart() == NoPart) || (windowsVersion() < WindowsVista)) ? ABS_DOWNNORMAL : ABS_DOWNHOVER;
219
    if (scrollbar->pressedPart() == NoPart)
219
    if (scrollbar->pressedPart() == NoPart)
220
        return ABS_DOWNHOT;
220
        return ABS_DOWNHOT;
221
    return (scrollbar->pressedPart() == part) ? ABS_DOWNPRESSED : ABS_DOWNNORMAL;
221
    return (scrollbar->pressedPart() == part) ? ABS_DOWNPRESSED : ABS_DOWNNORMAL;
- Source/WebCore/platform/graphics/chromium/GlyphPageTreeNodeChromiumWin.cpp -1 / +1 lines
Lines 134-140 static bool fillBMPGlyphs(unsigned offse Source/WebCore/platform/graphics/chromium/GlyphPageTreeNodeChromiumWin.cpp_sec1
134
    bool haveGlyphs = false;
134
    bool haveGlyphs = false;
135
    int invalidGlyph = 0xFFFF;
135
    int invalidGlyph = 0xFFFF;
136
    const DWORD cffTableTag = 0x20464643; // 4-byte identifier for OpenType CFF table ('CFF ').
136
    const DWORD cffTableTag = 0x20464643; // 4-byte identifier for OpenType CFF table ('CFF ').
137
    if (!isRunningOnVistaOrLater() && !(tm.tmPitchAndFamily & TMPF_TRUETYPE) && (GetFontData(dc, cffTableTag, 0, 0, 0) == GDI_ERROR))
137
    if ((windowsVersion() < WindowsVista) && !(tm.tmPitchAndFamily & TMPF_TRUETYPE) && (GetFontData(dc, cffTableTag, 0, 0, 0) == GDI_ERROR))
138
        invalidGlyph = 0x1F;
138
        invalidGlyph = 0x1F;
139
139
140
    Glyph spaceGlyph = 0;  // Glyph for a space. Lazily filled.
140
    Glyph spaceGlyph = 0;  // Glyph for a space. Lazily filled.
- Source/WebCore/platform/win/CursorWin.cpp -9 / +2 lines
Lines 30-35 Source/WebCore/platform/win/CursorWin.cpp_sec1
30
#include "BitmapInfo.h"
30
#include "BitmapInfo.h"
31
#include "Image.h"
31
#include "Image.h"
32
#include "IntPoint.h"
32
#include "IntPoint.h"
33
#include "SystemInfo.h"
33
34
34
#include <wtf/OwnPtr.h>
35
#include <wtf/OwnPtr.h>
35
36
Lines 39-58 Source/WebCore/platform/win/CursorWin.cpp_sec2
39
40
40
namespace WebCore {
41
namespace WebCore {
41
42
42
static inline bool supportsAlphaCursors() 
43
{
44
    OSVERSIONINFO osinfo = {0};
45
    osinfo.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
46
    GetVersionEx(&osinfo);
47
    return osinfo.dwMajorVersion > 5 || (osinfo.dwMajorVersion == 5 && osinfo.dwMinorVersion > 0);
48
}
49
50
static PassRefPtr<SharedCursor> createSharedCursor(Image* img, const IntPoint& hotSpot)
43
static PassRefPtr<SharedCursor> createSharedCursor(Image* img, const IntPoint& hotSpot)
51
{
44
{
52
    RefPtr<SharedCursor> impl;
45
    RefPtr<SharedCursor> impl;
53
46
54
    IntPoint effectiveHotSpot = determineHotSpot(img, hotSpot);
47
    IntPoint effectiveHotSpot = determineHotSpot(img, hotSpot);
55
    static bool doAlpha = supportsAlphaCursors();
48
    static bool doAlpha = windowsVersion() >= WindowsXP;
56
    BitmapInfo cursorImage = BitmapInfo::create(IntSize(img->width(), img->height()));
49
    BitmapInfo cursorImage = BitmapInfo::create(IntSize(img->width(), img->height()));
57
50
58
    HDC dc = GetDC(0);
51
    HDC dc = GetDC(0);
- Source/WebCore/platform/win/ScrollbarThemeWin.cpp -1 / +1 lines
Lines 100-106 ScrollbarThemeWin::ScrollbarThemeWin() Source/WebCore/platform/win/ScrollbarThemeWin.cpp_sec1
100
    if (!initialized) {
100
    if (!initialized) {
101
        initialized = true;
101
        initialized = true;
102
        checkAndInitScrollbarTheme();
102
        checkAndInitScrollbarTheme();
103
        runningVista = isRunningOnVistaOrLater();
103
        runningVista = (windowsVersion() >= WindowsVista);
104
    }
104
    }
105
}
105
}
106
106
- Source/WebCore/platform/win/SystemInfo.cpp -14 / +74 lines
Lines 27-56 Source/WebCore/platform/win/SystemInfo.cpp_sec1
27
#include "SystemInfo.h"
27
#include "SystemInfo.h"
28
28
29
#include <windows.h>
29
#include <windows.h>
30
#include <wtf/text/StringConcatenate.h>
30
31
31
namespace WebCore {
32
namespace WebCore {
32
33
33
bool isRunningOnVistaOrLater()
34
WindowsVersion windowsVersion(int* major, int* minor)
34
{
35
{
36
    static bool initialized = false;
37
    static WindowsVersion version;
38
    static int majorVersion, minorVersion;
39
40
    if (!initialized) {
41
        initialized = true;
35
#if OS(WINCE)
42
#if OS(WINCE)
36
    return false;
43
        OSVERSIONINFO versionInfo = {0};
37
#else
44
#else
38
    static bool isVistaOrLater;
45
        OSVERSIONINFOEX versionInfo = {0};
39
    static bool initialized;
46
#endif
40
47
        versionInfo.dwOSVersionInfoSize = sizeof(versionInfo);
41
    if (initialized)
48
        GetVersionEx(reinterpret_cast<OSVERSIONINFO*>(&versionInfo));
42
        return isVistaOrLater;
49
        majorVersion = versionInfo.dwMajorVersion;
50
        minorVersion = versionInfo.dwMinorVersion;
43
51
44
    initialized = true;
52
#if OS(WINCE)
53
        if (majorVersion >= 1 && majorVersion <= 7)
54
            version = static_cast<WindowsVersion>(WindowsCE1 + (majorVersion - 1));
55
        else
56
            version = (majorVersion < 1) ? WindowsCE1 : WindowsCE7;
57
#else
58
        if (versionInfo.dwPlatformId == VER_PLATFORM_WIN32s)
59
            version = Windows3_1;
60
        else if (versionInfo.dwPlatformId == VER_PLATFORM_WIN32_WINDOWS) {
61
            if (!minorVersion)
62
                version = Windows95;
63
            else
64
                version = (minorVersion == 10) ? Windows98 : WindowsME;
65
        } else {
66
            if (majorVersion == 5) {
67
                if (!minorVersion)
68
                    version = Windows2000;
69
                else
70
                    version = (minorVersion == 1) ? WindowsXP : WindowsServer2003;
71
            } else if (majorVersion >= 6) {
72
                if (versionInfo.wProductType == VER_NT_WORKSTATION)
73
                    version = (majorVersion == 6 && !minorVersion) ? WindowsVista : Windows7;
74
                else
75
                    version = WindowsServer2008;
76
            } else
77
                version = (majorVersion == 4) ? WindowsNT4 : WindowsNT3;
78
        }
79
#endif
80
    }
45
81
46
    OSVERSIONINFOEX vi = {0};
82
    if (major)
47
    vi.dwOSVersionInfoSize = sizeof(OSVERSIONINFOEX);
83
        *major = majorVersion;
48
    GetVersionEx(reinterpret_cast<OSVERSIONINFO*>(&vi));
84
    if (minor)
85
        *minor = minorVersion;
86
    return version;
87
}
49
88
50
    isVistaOrLater = vi.dwMajorVersion >= 6;
89
String windowsVersionForUAString()
90
{
91
    int major, minor;
92
    WindowsVersion version = windowsVersion(&major, &minor);
93
    switch (version) {
94
    case WindowsCE1:
95
    case WindowsCE2:
96
    case WindowsCE3:
97
        return "Windows CE";
98
    case WindowsCE4:
99
        return "Windows CE .NET";
100
    case Windows3_1:
101
        return "Windows 3.1";
102
    case Windows95:
103
        return "Windows 95";
104
    case Windows98:
105
        return "Windows 98";
106
    case WindowsME:
107
        return "Windows 98; Win 9x 4.90";
108
    case WindowsNT4:
109
        return "WinNT4.0";
110
    }
51
111
52
    return isVistaOrLater;
112
    char* familyName = (version >= WindowsNT3) ? "Windows NT " : "Windows CE ";
53
#endif
113
    return makeString(familyName, String::number(major), '.', String::number(minor));
54
}
114
}
55
115
56
} // namespace WebCore
116
} // namespace WebCore
- Source/WebCore/platform/win/SystemInfo.h -1 / +36 lines
Lines 26-34 Source/WebCore/platform/win/SystemInfo.h_sec1
26
#ifndef SystemInfo_h
26
#ifndef SystemInfo_h
27
#define SystemInfo_h
27
#define SystemInfo_h
28
28
29
#include <wtf/text/WTFString.h>
30
29
namespace WebCore {
31
namespace WebCore {
30
32
31
bool isRunningOnVistaOrLater();
33
// NOTE: Keep these in order so callers can do things like
34
// "if (windowsVersion() >= WindowsVista) ...". It's OK to change or add values,
35
// though.
36
enum WindowsVersion {
37
    // CE-based versions
38
    WindowsCE1 = 0,
39
    WindowsCE2,
40
    WindowsCE3,
41
    WindowsCE4,
42
    WindowsCE5,
43
    WindowsCE6,
44
    WindowsCE7,
45
    // 3.x-based versions
46
    Windows3_1,
47
    // 9x-based versions
48
    Windows95,
49
    Windows98,
50
    WindowsME,
51
    // NT-based versions
52
    WindowsNT3,
53
    WindowsNT4,
54
    Windows2000,
55
    WindowsXP,
56
    WindowsServer2003,
57
    WindowsVista,
58
    WindowsServer2008,
59
    Windows7,
60
};
61
62
// If supplied, |major| and |minor| are set to the OSVERSIONINFO::dwMajorVersion
63
// and dwMinorVersion field values, respectively.
64
WindowsVersion windowsVersion(int* major = 0, int* minor = 0);
65
66
String windowsVersionForUAString();
32
67
33
} // namespace WebCore
68
} // namespace WebCore
34
69
- Source/WebCore/rendering/RenderThemeChromiumWin.cpp -2 / +2 lines
Lines 141-148 bool ThemePainter::s_hasInstance = false Source/WebCore/rendering/RenderThemeChromiumWin.cpp_sec1
141
141
142
static void getNonClientMetrics(NONCLIENTMETRICS* metrics)
142
static void getNonClientMetrics(NONCLIENTMETRICS* metrics)
143
{
143
{
144
    static UINT size = isRunningOnVistaOrLater() ?
144
    static UINT size = (windowsVersion() >= WindowsVista) ?
145
        sizeof(NONCLIENTMETRICS) : NONCLIENTMETRICS_SIZE_PRE_VISTA;
145
        (sizeof NONCLIENTMETRICS) : NONCLIENTMETRICS_SIZE_PRE_VISTA;
146
    metrics->cbSize = size;
146
    metrics->cbSize = size;
147
    bool success = !!SystemParametersInfo(SPI_GETNONCLIENTMETRICS, size, metrics, 0);
147
    bool success = !!SystemParametersInfo(SPI_GETNONCLIENTMETRICS, size, metrics, 0);
148
    ASSERT(success);
148
    ASSERT(success);
- Source/WebCore/rendering/RenderThemeWin.cpp -6 / +8 lines
Lines 569-583 ThemeData RenderThemeWin::getThemeData(R Source/WebCore/rendering/RenderThemeWin.cpp_sec1
569
            result.m_state = determineState(o);
569
            result.m_state = determineState(o);
570
            break;
570
            break;
571
        case MenulistPart:
571
        case MenulistPart:
572
        case MenulistButtonPart:
572
        case MenulistButtonPart: {
573
            result.m_part = isRunningOnVistaOrLater() ? CP_DROPDOWNBUTTONRIGHT : CP_DROPDOWNBUTTON;
573
            const bool isVistaOrLater = (windowsVersion() >= WindowsVista);
574
            if (isRunningOnVistaOrLater() && documentIsInApplicationChromeMode(o->document())) {
574
            result.m_part = isVistaOrLater ? CP_DROPDOWNBUTTONRIGHT : CP_DROPDOWNBUTTON;
575
            if (isVistaOrLater && documentIsInApplicationChromeMode(o->document())) {
575
                // The "readonly" look we use in application chrome mode
576
                // The "readonly" look we use in application chrome mode
576
                // only uses a "normal" look for the drop down button.
577
                // only uses a "normal" look for the drop down button.
577
                result.m_state = TS_NORMAL;
578
                result.m_state = TS_NORMAL;
578
            } else
579
            } else
579
                result.m_state = determineState(o);
580
                result.m_state = determineState(o);
580
            break;
581
            break;
582
        }
581
        case RadioPart:
583
        case RadioPart:
582
            result.m_part = BP_RADIO;
584
            result.m_part = BP_RADIO;
583
            result.m_state = determineState(o);
585
            result.m_state = determineState(o);
Lines 585-591 ThemeData RenderThemeWin::getThemeData(R Source/WebCore/rendering/RenderThemeWin.cpp_sec2
585
        case SearchFieldPart:
587
        case SearchFieldPart:
586
        case TextFieldPart:
588
        case TextFieldPart:
587
        case TextAreaPart:
589
        case TextAreaPart:
588
            result.m_part = isRunningOnVistaOrLater() ? EP_EDITBORDER_NOSCROLL : TFP_TEXTFIELD;
590
            result.m_part = (windowsVersion() >= WindowsVista) ? EP_EDITBORDER_NOSCROLL : TFP_TEXTFIELD;
589
            result.m_state = determineState(o);
591
            result.m_state = determineState(o);
590
            break;
592
            break;
591
        case SliderHorizontalPart:
593
        case SliderHorizontalPart:
Lines 728-734 bool RenderThemeWin::paintMenuList(Rende Source/WebCore/rendering/RenderThemeWin.cpp_sec3
728
{
730
{
729
    HANDLE theme;
731
    HANDLE theme;
730
    int part;
732
    int part;
731
    if (haveTheme && isRunningOnVistaOrLater()) {
733
    if (haveTheme && (windowsVersion() >= WindowsVista)) {
732
        theme = menuListTheme();
734
        theme = menuListTheme();
733
        if (documentIsInApplicationChromeMode(o->document()))
735
        if (documentIsInApplicationChromeMode(o->document()))
734
            part = CP_READONLY;
736
            part = CP_READONLY;
Lines 792-798 bool RenderThemeWin::paintMenuListButton Source/WebCore/rendering/RenderThemeWin.cpp_sec4
792
        buttonRect.setX(buttonRect.maxX() - dropDownButtonWidth);
794
        buttonRect.setX(buttonRect.maxX() - dropDownButtonWidth);
793
    buttonRect.setWidth(dropDownButtonWidth);
795
    buttonRect.setWidth(dropDownButtonWidth);
794
796
795
    if (isRunningOnVistaOrLater()) {
797
    if ((windowsVersion() >= WindowsVista)) {
796
        // Outset the top, right, and bottom borders of the button so that they coincide with the <select>'s border.
798
        // Outset the top, right, and bottom borders of the button so that they coincide with the <select>'s border.
797
        buttonRect.setY(buttonRect.y() - vistaMenuListButtonOutset);
799
        buttonRect.setY(buttonRect.y() - vistaMenuListButtonOutset);
798
        buttonRect.setHeight(buttonRect.height() + 2 * vistaMenuListButtonOutset);
800
        buttonRect.setHeight(buttonRect.height() + 2 * vistaMenuListButtonOutset);
- Source/WebKit2/ChangeLog +10 lines
Lines 1-3 Source/WebKit2/ChangeLog_sec1
1
2011-03-09  Peter Kasting  <pkasting@google.com>
2
3
        Reviewed by NOBODY (OOPS!).
4
5
        Unify Windows version checks.
6
        https://bugs.webkit.org/show_bug.cgi?id=55979
7
8
        * UIProcess/win/WebPageProxyWin.cpp:
9
        (WebKit::WebPageProxy::standardUserAgent):
10
1
2011-03-09  Brent Fulgham  <bfulgham@webkit.org>
11
2011-03-09  Brent Fulgham  <bfulgham@webkit.org>
2
12
3
        Unreviewed build correction.
13
        Unreviewed build correction.
- Source/WebKit2/UIProcess/win/WebPageProxyWin.cpp -28 / +3 lines
Lines 25-30 Source/WebKit2/UIProcess/win/WebPageProxyWin.cpp_sec1
25
25
26
#include "config.h"
26
#include "config.h"
27
#include "WebPageProxy.h"
27
#include "WebPageProxy.h"
28
#include "SystemInfo.h"
28
29
29
#include "resource.h"
30
#include "resource.h"
30
#include <tchar.h>
31
#include <tchar.h>
Lines 36-65 using namespace WebCore; Source/WebKit2/UIProcess/win/WebPageProxyWin.cpp_sec2
36
37
37
namespace WebKit {
38
namespace WebKit {
38
39
39
static String windowsVersion()
40
{
41
   String osVersion;
42
   OSVERSIONINFO versionInfo = { 0 };
43
   versionInfo.dwOSVersionInfoSize = sizeof(versionInfo);
44
   ::GetVersionEx(&versionInfo);
45
46
   if (versionInfo.dwPlatformId == VER_PLATFORM_WIN32_WINDOWS) {
47
       if (versionInfo.dwMajorVersion == 4) {
48
           if (versionInfo.dwMinorVersion == 0)
49
               osVersion = "Windows 95";
50
           else if (versionInfo.dwMinorVersion == 10)
51
               osVersion = "Windows 98";
52
           else if (versionInfo.dwMinorVersion == 90)
53
               osVersion = "Windows 98; Win 9x 4.90";
54
       }
55
   } else if (versionInfo.dwPlatformId == VER_PLATFORM_WIN32_NT)
56
       osVersion = makeString("Windows NT ", String::number(versionInfo.dwMajorVersion), '.', String::number(versionInfo.dwMinorVersion));
57
58
   if (!osVersion.length())
59
       osVersion = makeString("Windows ", String::number(versionInfo.dwMajorVersion), '.', String::number(versionInfo.dwMinorVersion));
60
   return osVersion;
61
}
62
63
static String userVisibleWebKitVersionString()
40
static String userVisibleWebKitVersionString()
64
{
41
{
65
    LPWSTR buildNumberStringPtr;
42
    LPWSTR buildNumberStringPtr;
Lines 71-82 static String userVisibleWebKitVersionSt Source/WebKit2/UIProcess/win/WebPageProxyWin.cpp_sec3
71
48
72
String WebPageProxy::standardUserAgent(const String& applicationNameForUserAgent)
49
String WebPageProxy::standardUserAgent(const String& applicationNameForUserAgent)
73
{
50
{
74
    DEFINE_STATIC_LOCAL(String, osVersion, (windowsVersion()));
51
    DEFINE_STATIC_LOCAL(String, osVersion, (windowsVersionForUAString()));
75
    DEFINE_STATIC_LOCAL(String, webKitVersion, (userVisibleWebKitVersionString()));
52
    DEFINE_STATIC_LOCAL(String, webKitVersion, (userVisibleWebKitVersionString()));
76
53
77
    if (applicationNameForUserAgent.isEmpty())
54
    return makeString("Mozilla/5.0 (", osVersion, ") AppleWebKit/", webKitVersion, " (KHTML, like Gecko)", applicationNameForUserAgent.isEmpty() ? "" : " ", applicationNameForUserAgent);
78
        return makeString("Mozilla/5.0 (", osVersion, ") AppleWebKit/", webKitVersion, " (KHTML, like Gecko)");
79
    return makeString("Mozilla/5.0 (", osVersion, ") AppleWebKit/", webKitVersion, " (KHTML, like Gecko) ", applicationNameForUserAgent);
80
}
55
}
81
56
82
} // namespace WebKit
57
} // namespace WebKit
- Source/WebKit/gtk/ChangeLog +10 lines
Lines 1-3 Source/WebKit/gtk/ChangeLog_sec1
1
2011-03-09  Peter Kasting  <pkasting@google.com>
2
3
        Reviewed by NOBODY (OOPS!).
4
5
        Unify Windows version checks.
6
        https://bugs.webkit.org/show_bug.cgi?id=55979
7
8
        * webkit/webkitwebsettings.cpp:
9
        (webkitOSVersion):
10
1
2011-03-08  Christian Dywan  <christian@lanedo.com>
11
2011-03-08  Christian Dywan  <christian@lanedo.com>
2
12
3
        Reviewed by Martin Robinson.
13
        Reviewed by Martin Robinson.
- Source/WebKit/gtk/webkit/webkitwebsettings.cpp -1 / +3 lines
Lines 39-44 Source/WebKit/gtk/webkit/webkitwebsettings.cpp_sec1
39
39
40
#if OS(UNIX)
40
#if OS(UNIX)
41
#include <sys/utsname.h>
41
#include <sys/utsname.h>
42
#elif OS(WINDOWS)
43
#include "SystemInfo.h"
42
#endif
44
#endif
43
45
44
/**
46
/**
Lines 208-214 static String webkitOSVersion() Source/WebKit/gtk/webkit/webkitwebsettings.cpp_sec2
208
    else
210
    else
209
        uaOSVersion = String("Unknown");
211
        uaOSVersion = String("Unknown");
210
#elif OS(WINDOWS)
212
#elif OS(WINDOWS)
211
    DEFINE_STATIC_LOCAL(const String, uaOSVersion, (String("Windows")));
213
    DEFINE_STATIC_LOCAL(const String, uaOSVersion, (windowsVersionForUAString()));
212
#else
214
#else
213
    DEFINE_STATIC_LOCAL(const String, uaOSVersion, (String("Unknown")));
215
    DEFINE_STATIC_LOCAL(const String, uaOSVersion, (String("Unknown")));
214
#endif
216
#endif
- Source/WebKit/qt/ChangeLog +10 lines
Lines 1-3 Source/WebKit/qt/ChangeLog_sec1
1
2011-03-09  Peter Kasting  <pkasting@google.com>
2
3
        Reviewed by NOBODY (OOPS!).
4
5
        Unify Windows version checks.
6
        https://bugs.webkit.org/show_bug.cgi?id=55979
7
8
        * Api/qwebpage.cpp:
9
        (QWebPage::userAgentForUrl):
10
1
2011-03-07  Sam Weinig  <sam@webkit.org>
11
2011-03-07  Sam Weinig  <sam@webkit.org>
2
12
3
        Reviewed by Anders Carlsson.
13
        Reviewed by Anders Carlsson.
- Source/WebKit/qt/Api/qwebpage.cpp -46 / +4 lines
Lines 104-109 Source/WebKit/qt/Api/qwebpage.cpp_sec1
104
#include "Scrollbar.h"
104
#include "Scrollbar.h"
105
#include "SecurityOrigin.h"
105
#include "SecurityOrigin.h"
106
#include "Settings.h"
106
#include "Settings.h"
107
#if defined Q_OS_WIN32
108
#include "SystemInfo.h"
109
#endif // Q_OS_WIN32
107
#include "TextIterator.h"
110
#include "TextIterator.h"
108
#include "WebPlatformStrategies.h"
111
#include "WebPlatformStrategies.h"
109
#include "WindowFeatures.h"
112
#include "WindowFeatures.h"
Lines 3772-3823 QString QWebPage::userAgentForUrl(const Source/WebKit/qt/Api/qwebpage.cpp_sec2
3772
#ifdef Q_OS_AIX
3775
#ifdef Q_OS_AIX
3773
        firstPartTemp += QString::fromLatin1("AIX");
3776
        firstPartTemp += QString::fromLatin1("AIX");
3774
#elif defined Q_OS_WIN32
3777
#elif defined Q_OS_WIN32
3775
3778
        firstPartTemp += windowsVersionForUAString();
3776
        switch (QSysInfo::WindowsVersion) {
3777
        case QSysInfo::WV_32s:
3778
            firstPartTemp += QString::fromLatin1("Windows 3.1");
3779
            break;
3780
        case QSysInfo::WV_95:
3781
            firstPartTemp += QString::fromLatin1("Windows 95");
3782
            break;
3783
        case QSysInfo::WV_98:
3784
            firstPartTemp += QString::fromLatin1("Windows 98");
3785
            break;
3786
        case QSysInfo::WV_Me:
3787
            firstPartTemp += QString::fromLatin1("Windows 98; Win 9x 4.90");
3788
            break;
3789
        case QSysInfo::WV_NT:
3790
            firstPartTemp += QString::fromLatin1("WinNT4.0");
3791
            break;
3792
        case QSysInfo::WV_2000:
3793
            firstPartTemp += QString::fromLatin1("Windows NT 5.0");
3794
            break;
3795
        case QSysInfo::WV_XP:
3796
            firstPartTemp += QString::fromLatin1("Windows NT 5.1");
3797
            break;
3798
        case QSysInfo::WV_2003:
3799
            firstPartTemp += QString::fromLatin1("Windows NT 5.2");
3800
            break;
3801
        case QSysInfo::WV_VISTA:
3802
            firstPartTemp += QString::fromLatin1("Windows NT 6.0");
3803
            break;
3804
         case QSysInfo::WV_WINDOWS7:
3805
            firstPartTemp += QString::fromLatin1("Windows NT 6.1");
3806
            break;
3807
         case QSysInfo::WV_CE:
3808
            firstPartTemp += QString::fromLatin1("Windows CE");
3809
            break;
3810
         case QSysInfo::WV_CENET:
3811
            firstPartTemp += QString::fromLatin1("Windows CE .NET");
3812
            break;
3813
         case QSysInfo::WV_CE_5:
3814
            firstPartTemp += QString::fromLatin1("Windows CE 5.x");
3815
            break;
3816
         case QSysInfo::WV_CE_6:
3817
            firstPartTemp += QString::fromLatin1("Windows CE 6.x");
3818
            break;
3819
        }
3820
3821
#elif defined Q_OS_DARWIN
3779
#elif defined Q_OS_DARWIN
3822
#ifdef __i386__ || __x86_64__
3780
#ifdef __i386__ || __x86_64__
3823
        firstPartTemp += QString::fromLatin1("Intel Mac OS X");
3781
        firstPartTemp += QString::fromLatin1("Intel Mac OS X");
- Source/WebKit/win/ChangeLog +11 lines
Lines 1-3 Source/WebKit/win/ChangeLog_sec1
1
2011-03-09  Peter Kasting  <pkasting@google.com>
2
3
        Reviewed by NOBODY (OOPS!).
4
5
        Unify Windows version checks.
6
        https://bugs.webkit.org/show_bug.cgi?id=55979
7
8
        * WebView.cpp:
9
        (WebView::standardUserAgentWithApplicationName):
10
        (webKitVersionString):
11
1
2011-03-07  Sam Weinig  <sam@webkit.org>
12
2011-03-07  Sam Weinig  <sam@webkit.org>
2
13
3
        Reviewed by Anders Carlsson.
14
        Reviewed by Anders Carlsson.
- Source/WebKit/win/WebView.cpp -30 / +7 lines
Lines 31-36 Source/WebKit/win/WebView.cpp_sec1
31
#include "FullscreenVideoController.h"
31
#include "FullscreenVideoController.h"
32
#include "MarshallingHelpers.h"
32
#include "MarshallingHelpers.h"
33
#include "SoftLinking.h"
33
#include "SoftLinking.h"
34
#include "SystemInfo.h"
34
#include "WebBackForwardList.h"
35
#include "WebBackForwardList.h"
35
#include "WebChromeClient.h"
36
#include "WebChromeClient.h"
36
#include "WebContextMenuClient.h"
37
#include "WebContextMenuClient.h"
Lines 184-191 using JSC::JSLock; Source/WebKit/win/WebView.cpp_sec2
184
static HMODULE accessibilityLib;
185
static HMODULE accessibilityLib;
185
static HashSet<WebView*> pendingDeleteBackingStoreSet;
186
static HashSet<WebView*> pendingDeleteBackingStoreSet;
186
187
187
static String osVersion();
188
static String webKitVersionString();
188
static String webKitVersion();
189
189
190
WebView* kit(Page* page)
190
WebView* kit(Page* page)
191
{
191
{
Lines 1244-1252 bool WebView::canHandleRequest(const Web Source/WebKit/win/WebView.cpp_sec3
1244
1244
1245
String WebView::standardUserAgentWithApplicationName(const String& applicationName)
1245
String WebView::standardUserAgentWithApplicationName(const String& applicationName)
1246
{
1246
{
1247
    if (applicationName.isEmpty())
1247
    DEFINE_STATIC_LOCAL(String, osVersion, (windowsVersionForUAString()));
1248
        return makeString("Mozilla/5.0 (", osVersion(), ") AppleWebKit/", webKitVersion(), " (KHTML, like Gecko)");
1248
    DEFINE_STATIC_LOCAL(String, webKitVersion, (webKitVersionString()));
1249
    return makeString("Mozilla/5.0 (", osVersion(), ") AppleWebKit/", webKitVersion(), " (KHTML, like Gecko) ", applicationName);
1249
1250
    return makeString("Mozilla/5.0 (", osVersion, ") AppleWebKit/", webKitVersion, " (KHTML, like Gecko)", applicationNameForUserAgent.isEmpty() ? "" : " ", applicationNameForUserAgent);
1250
}
1251
}
1251
1252
1252
Page* WebView::page()
1253
Page* WebView::page()
Lines 2336-2366 bool WebView::developerExtrasEnabled() c Source/WebKit/win/WebView.cpp_sec4
2336
#endif
2337
#endif
2337
}
2338
}
2338
2339
2339
static String osVersion()
2340
static String webKitVersionString()
2340
{
2341
    String osVersion;
2342
    OSVERSIONINFO versionInfo = {0};
2343
    versionInfo.dwOSVersionInfoSize = sizeof(versionInfo);
2344
    GetVersionEx(&versionInfo);
2345
2346
    if (versionInfo.dwPlatformId == VER_PLATFORM_WIN32_WINDOWS) {
2347
        if (versionInfo.dwMajorVersion == 4) {
2348
            if (versionInfo.dwMinorVersion == 0)
2349
                osVersion = "Windows 95";
2350
            else if (versionInfo.dwMinorVersion == 10)
2351
                osVersion = "Windows 98";
2352
            else if (versionInfo.dwMinorVersion == 90)
2353
                osVersion = "Windows 98; Win 9x 4.90";
2354
        }
2355
    } else if (versionInfo.dwPlatformId == VER_PLATFORM_WIN32_NT)
2356
        osVersion = makeString("Windows NT ", String::number(versionInfo.dwMajorVersion), '.', String::number(versionInfo.dwMinorVersion));
2357
2358
    if (!osVersion.length())
2359
        osVersion = makeString("Windows ", String::number(versionInfo.dwMajorVersion), '.', String::number(versionInfo.dwMinorVersion));
2360
    return osVersion;
2361
}
2362
2363
static String webKitVersion()
2364
{
2341
{
2365
    LPWSTR buildNumberStringPtr;
2342
    LPWSTR buildNumberStringPtr;
2366
    if (!::LoadStringW(gInstance, BUILD_NUMBER, reinterpret_cast<LPWSTR>(&buildNumberStringPtr), 0) || !buildNumberStringPtr)
2343
    if (!::LoadStringW(gInstance, BUILD_NUMBER, reinterpret_cast<LPWSTR>(&buildNumberStringPtr), 0) || !buildNumberStringPtr)

Return to Bug 55979