cb15ca86269ea5e23298a040fbb1a3973b7ab885
[WebKit-https.git] / Source / WebCore / rendering / RenderThemeWin.cpp
1 /*
2  * Copyright (C) 2006, 2007 Apple Inc.
3  * Copyright (C) 2009 Kenneth Rohde Christiansen
4  *
5  * This library is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Library General Public
7  * License as published by the Free Software Foundation; either
8  * version 2 of the License, or (at your option) any later version.
9  *
10  * This library is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13  * Library General Public License for more details.
14  *
15  * You should have received a copy of the GNU Library General Public License
16  * along with this library; see the file COPYING.LIB.  If not, write to
17  * the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18  * Boston, MA 02111-1307, USA.
19  *
20  */
21
22 #include "config.h"
23 #include "RenderThemeWin.h"
24
25 #include "CSSValueKeywords.h"
26 #include "Element.h"
27 #include "FontMetrics.h"
28 #include "Frame.h"
29 #include "GraphicsContext.h"
30 #include "LocalWindowsContext.h"
31 #include "PaintInfo.h"
32 #include "RenderSlider.h"
33 #include "Settings.h"
34 #include "SoftLinking.h"
35 #include "SystemInfo.h"
36 #include "UserAgentStyleSheets.h"
37
38 #if ENABLE(VIDEO)
39 #include "RenderMediaControls.h"
40 #endif
41
42 #include <tchar.h>
43
44 /* 
45  * The following constants are used to determine how a widget is drawn using
46  * Windows' Theme API. For more information on theme parts and states see
47  * http://msdn.microsoft.com/library/default.asp?url=/library/en-us/shellcc/platform/commctls/userex/topics/partsandstates.asp
48  */
49
50 // Generic state constants
51 #define TS_NORMAL    1
52 #define TS_HOVER     2
53 #define TS_ACTIVE    3
54 #define TS_DISABLED  4
55 #define TS_FOCUSED   5
56
57 // Button constants
58 #define BP_BUTTON    1
59 #define BP_RADIO     2
60 #define BP_CHECKBOX  3
61
62 // Textfield constants
63 #define TFP_TEXTFIELD 1
64 #define EP_EDITBORDER_NOSCROLL 6
65 #define TFS_READONLY  6
66
67 // ComboBox constants (from vsstyle.h)
68 #define CP_DROPDOWNBUTTON 1
69 #define CP_BORDER 4
70 #define CP_READONLY 5
71 #define CP_DROPDOWNBUTTONRIGHT 6
72
73 // TrackBar (slider) parts
74 #define TKP_TRACK       1
75 #define TKP_TRACKVERT   2
76
77 // TrackBar (slider) thumb parts
78 #define TKP_THUMBBOTTOM 4
79 #define TKP_THUMBTOP    5
80 #define TKP_THUMBLEFT   7
81 #define TKP_THUMBRIGHT  8
82
83 // Trackbar (slider) thumb states
84 #define TUS_NORMAL      1
85 #define TUS_HOT         2
86 #define TUS_PRESSED     3
87 #define TUS_FOCUSED     4
88 #define TUS_DISABLED    5
89
90 // button states
91 #define PBS_NORMAL      1
92 #define PBS_HOT         2
93 #define PBS_PRESSED     3
94 #define PBS_DISABLED    4
95 #define PBS_DEFAULTED   5
96
97 // Spin button parts
98 #define SPNP_UP         1
99 #define SPNP_DOWN       2
100
101 // Spin button states
102 #define DNS_NORMAL      1
103 #define DNS_HOT         2
104 #define DNS_PRESSED     3
105 #define DNS_DISABLED    4
106 #define UPS_NORMAL      1
107 #define UPS_HOT         2
108 #define UPS_PRESSED     3
109 #define UPS_DISABLED    4
110
111
112 SOFT_LINK_LIBRARY(uxtheme)
113 SOFT_LINK(uxtheme, OpenThemeData, HANDLE, WINAPI, (HWND hwnd, LPCWSTR pszClassList), (hwnd, pszClassList))
114 SOFT_LINK(uxtheme, CloseThemeData, HRESULT, WINAPI, (HANDLE hTheme), (hTheme))
115 SOFT_LINK(uxtheme, DrawThemeBackground, HRESULT, WINAPI, (HANDLE hTheme, HDC hdc, int iPartId, int iStateId, const RECT* pRect, const RECT* pClipRect), (hTheme, hdc, iPartId, iStateId, pRect, pClipRect))
116 SOFT_LINK(uxtheme, IsThemeActive, BOOL, WINAPI, (), ())
117 SOFT_LINK(uxtheme, IsThemeBackgroundPartiallyTransparent, BOOL, WINAPI, (HANDLE hTheme, int iPartId, int iStateId), (hTheme, iPartId, iStateId))
118
119 static bool haveTheme;
120
121 static const unsigned vistaMenuListButtonOutset = 1;
122
123 using namespace std;
124
125 namespace WebCore {
126
127 // This is the fixed width IE and Firefox use for buttons on dropdown menus
128 static const int dropDownButtonWidth = 17;
129
130 static const int shell32MagnifierIconIndex = 22;
131
132 // Default font size to match Firefox.
133 static const float defaultControlFontPixelSize = 13;
134
135 static const float defaultCancelButtonSize = 9;
136 static const float minCancelButtonSize = 5;
137 static const float maxCancelButtonSize = 21;
138 static const float defaultSearchFieldResultsDecorationSize = 13;
139 static const float minSearchFieldResultsDecorationSize = 9;
140 static const float maxSearchFieldResultsDecorationSize = 30;
141 static const float defaultSearchFieldResultsButtonWidth = 18;
142
143 static bool gWebKitIsBeingUnloaded;
144
145 static bool documentIsInApplicationChromeMode(const Document* document)
146 {
147     Settings* settings = document->settings();
148     return settings && settings->applicationChromeMode();
149 }
150
151 void RenderThemeWin::setWebKitIsBeingUnloaded()
152 {
153     gWebKitIsBeingUnloaded = true;
154 }
155
156 PassRefPtr<RenderTheme> RenderThemeWin::create()
157 {
158     return adoptRef(new RenderThemeWin);
159 }
160
161 PassRefPtr<RenderTheme> RenderTheme::themeForPage(Page* page)
162 {
163     static RenderTheme* winTheme = RenderThemeWin::create().leakRef();
164     return winTheme;
165 }
166
167 RenderThemeWin::RenderThemeWin()
168     : m_buttonTheme(0)
169     , m_textFieldTheme(0)
170     , m_menuListTheme(0)
171     , m_sliderTheme(0)
172     , m_spinButtonTheme(0)
173 {
174     haveTheme = uxthemeLibrary() && IsThemeActive();
175 }
176
177 RenderThemeWin::~RenderThemeWin()
178 {
179     // If WebKit is being unloaded, then uxtheme.dll is no longer available.
180     if (gWebKitIsBeingUnloaded || !uxthemeLibrary())
181         return;
182     close();
183 }
184
185 HANDLE RenderThemeWin::buttonTheme() const
186 {
187     if (haveTheme && !m_buttonTheme)
188         m_buttonTheme = OpenThemeData(0, L"Button");
189     return m_buttonTheme;
190 }
191
192 HANDLE RenderThemeWin::textFieldTheme() const
193 {
194     if (haveTheme && !m_textFieldTheme)
195         m_textFieldTheme = OpenThemeData(0, L"Edit");
196     return m_textFieldTheme;
197 }
198
199 HANDLE RenderThemeWin::menuListTheme() const
200 {
201     if (haveTheme && !m_menuListTheme)
202         m_menuListTheme = OpenThemeData(0, L"ComboBox");
203     return m_menuListTheme;
204 }
205
206 HANDLE RenderThemeWin::sliderTheme() const
207 {
208     if (haveTheme && !m_sliderTheme)
209         m_sliderTheme = OpenThemeData(0, L"TrackBar");
210     return m_sliderTheme;
211 }
212
213 HANDLE RenderThemeWin::spinButtonTheme() const
214 {
215     if (haveTheme && !m_spinButtonTheme)
216         m_spinButtonTheme = OpenThemeData(0, L"Spin");
217     return m_spinButtonTheme;
218 }
219
220 void RenderThemeWin::close()
221 {
222     // This method will need to be called when the OS theme changes to flush our cached themes.
223     if (m_buttonTheme)
224         CloseThemeData(m_buttonTheme);
225     if (m_textFieldTheme)
226         CloseThemeData(m_textFieldTheme);
227     if (m_menuListTheme)
228         CloseThemeData(m_menuListTheme);
229     if (m_sliderTheme)
230         CloseThemeData(m_sliderTheme);
231     if (m_spinButtonTheme)
232         CloseThemeData(m_spinButtonTheme);
233     m_buttonTheme = m_textFieldTheme = m_menuListTheme = m_sliderTheme = m_spinButtonTheme = 0;
234
235     haveTheme = uxthemeLibrary() && IsThemeActive();
236 }
237
238 void RenderThemeWin::themeChanged()
239 {
240     close();
241 }
242
243 String RenderThemeWin::extraDefaultStyleSheet()
244 {
245     return String(themeWinUserAgentStyleSheet, sizeof(themeWinUserAgentStyleSheet));
246 }
247
248 String RenderThemeWin::extraQuirksStyleSheet()
249 {
250     return String(themeWinQuirksUserAgentStyleSheet, sizeof(themeWinQuirksUserAgentStyleSheet));
251 }
252
253 bool RenderThemeWin::supportsHover(const RenderStyle*) const
254 {
255     // The Classic/2k look has no hover effects.
256     return haveTheme;
257 }
258
259 Color RenderThemeWin::platformActiveSelectionBackgroundColor() const
260 {
261     COLORREF color = GetSysColor(COLOR_HIGHLIGHT);
262     return Color(GetRValue(color), GetGValue(color), GetBValue(color));
263 }
264
265 Color RenderThemeWin::platformInactiveSelectionBackgroundColor() const
266 {
267     // This color matches Firefox.
268     return Color(176, 176, 176);
269 }
270
271 Color RenderThemeWin::platformActiveSelectionForegroundColor() const
272 {
273     COLORREF color = GetSysColor(COLOR_HIGHLIGHTTEXT);
274     return Color(GetRValue(color), GetGValue(color), GetBValue(color));
275 }
276
277 Color RenderThemeWin::platformInactiveSelectionForegroundColor() const
278 {
279     return platformActiveSelectionForegroundColor();
280 }
281
282 static void fillFontDescription(FontDescription& fontDescription, LOGFONT& logFont, float fontSize)
283 {    
284     fontDescription.setIsAbsoluteSize(true);
285     fontDescription.setGenericFamily(FontDescription::NoFamily);
286     fontDescription.firstFamily().setFamily(String(logFont.lfFaceName));
287     fontDescription.setSpecifiedSize(fontSize);
288     fontDescription.setWeight(logFont.lfWeight >= 700 ? FontWeightBold : FontWeightNormal); // FIXME: Use real weight.
289     fontDescription.setItalic(logFont.lfItalic);
290 }
291
292 static void fillFontDescription(FontDescription& fontDescription, LOGFONT& logFont)
293 {   
294     fillFontDescription(fontDescription, logFont, abs(logFont.lfHeight));
295 }
296
297 void RenderThemeWin::systemFont(int propId, FontDescription& fontDescription) const
298 {
299     static FontDescription captionFont;
300     static FontDescription controlFont;
301     static FontDescription smallCaptionFont;
302     static FontDescription menuFont;
303     static FontDescription iconFont;
304     static FontDescription messageBoxFont;
305     static FontDescription statusBarFont;
306     static FontDescription systemFont;
307     
308     static bool initialized;
309     static NONCLIENTMETRICS ncm;
310
311     if (!initialized) {
312         initialized = true;
313         ncm.cbSize = sizeof(NONCLIENTMETRICS);
314         ::SystemParametersInfo(SPI_GETNONCLIENTMETRICS, sizeof(ncm), &ncm, 0);
315     }
316  
317     switch (propId) {
318         case CSSValueIcon: {
319             if (!iconFont.isAbsoluteSize()) {
320                 LOGFONT logFont;
321                 ::SystemParametersInfo(SPI_GETICONTITLELOGFONT, sizeof(logFont), &logFont, 0);
322                 fillFontDescription(iconFont, logFont);
323             }
324             fontDescription = iconFont;
325             break;
326         }
327         case CSSValueMenu:
328             if (!menuFont.isAbsoluteSize())
329                 fillFontDescription(menuFont, ncm.lfMenuFont);
330             fontDescription = menuFont;
331             break;
332         case CSSValueMessageBox:
333             if (!messageBoxFont.isAbsoluteSize())
334                 fillFontDescription(messageBoxFont, ncm.lfMessageFont);
335             fontDescription = messageBoxFont;
336             break;
337         case CSSValueStatusBar:
338             if (!statusBarFont.isAbsoluteSize())
339                 fillFontDescription(statusBarFont, ncm.lfStatusFont);
340             fontDescription = statusBarFont;
341             break;
342         case CSSValueCaption:
343             if (!captionFont.isAbsoluteSize())
344                 fillFontDescription(captionFont, ncm.lfCaptionFont);
345             fontDescription = captionFont;
346             break;
347         case CSSValueSmallCaption:
348             if (!smallCaptionFont.isAbsoluteSize())
349                 fillFontDescription(smallCaptionFont, ncm.lfSmCaptionFont);
350             fontDescription = smallCaptionFont;
351             break;
352         case CSSValueWebkitSmallControl:
353         case CSSValueWebkitMiniControl: // Just map to small.
354         case CSSValueWebkitControl: // Just map to small.
355             if (!controlFont.isAbsoluteSize()) {
356                 HGDIOBJ hGDI = ::GetStockObject(DEFAULT_GUI_FONT);
357                 if (hGDI) {
358                     LOGFONT logFont;
359                     if (::GetObject(hGDI, sizeof(logFont), &logFont) > 0)
360                         fillFontDescription(controlFont, logFont, defaultControlFontPixelSize);
361                 }
362             }
363             fontDescription = controlFont;
364             break;
365         default: { // Everything else uses the stock GUI font.
366             if (!systemFont.isAbsoluteSize()) {
367                 HGDIOBJ hGDI = ::GetStockObject(DEFAULT_GUI_FONT);
368                 if (hGDI) {
369                     LOGFONT logFont;
370                     if (::GetObject(hGDI, sizeof(logFont), &logFont) > 0)
371                         fillFontDescription(systemFont, logFont);
372                 }
373             }
374             fontDescription = systemFont;
375         }
376     }
377 }
378
379 bool RenderThemeWin::supportsFocus(ControlPart appearance) const
380 {
381     switch (appearance) {
382         case PushButtonPart:
383         case ButtonPart:
384         case DefaultButtonPart:
385             return true;
386         default:
387             return false;
388     }
389 }
390
391 bool RenderThemeWin::supportsFocusRing(const RenderStyle* style) const
392 {
393     return supportsFocus(style->appearance());
394 }
395
396 unsigned RenderThemeWin::determineClassicState(RenderObject* o, ControlSubPart subPart)
397 {
398     unsigned state = 0;
399     switch (o->style()->appearance()) {
400         case PushButtonPart:
401         case ButtonPart:
402         case DefaultButtonPart:
403             state = DFCS_BUTTONPUSH;
404             if (!isEnabled(o))
405                 state |= DFCS_INACTIVE;
406             else if (isPressed(o))
407                 state |= DFCS_PUSHED;
408             break;
409         case RadioPart:
410         case CheckboxPart:
411             state = (o->style()->appearance() == RadioPart) ? DFCS_BUTTONRADIO : DFCS_BUTTONCHECK;
412             if (isChecked(o))
413                 state |= DFCS_CHECKED;
414             if (!isEnabled(o))
415                 state |= DFCS_INACTIVE;
416             else if (isPressed(o))
417                 state |= DFCS_PUSHED;
418             break;
419         case MenulistPart:
420             state = DFCS_SCROLLCOMBOBOX;
421             if (!isEnabled(o))
422                 state |= DFCS_INACTIVE;
423             else if (isPressed(o))
424                 state |= DFCS_PUSHED;
425             break;
426         case InnerSpinButtonPart: {
427             bool isUpButton = subPart == SpinButtonUp;
428             state = isUpButton ? DFCS_SCROLLUP : DFCS_SCROLLDOWN;
429             if (!isEnabled(o) || isReadOnlyControl(o))
430                 state |= DFCS_INACTIVE;
431             else if (isPressed(o) && isUpButton == isSpinUpButtonPartPressed(o))
432                 state |= DFCS_PUSHED;
433             else if (isHovered(o) && isUpButton == isSpinUpButtonPartHovered(o))
434                 state |= DFCS_HOT;
435             break;
436         }
437         default:
438             break;
439     }
440     return state;
441 }
442
443 unsigned RenderThemeWin::determineState(RenderObject* o)
444 {
445     unsigned result = TS_NORMAL;
446     ControlPart appearance = o->style()->appearance();
447     if (!isEnabled(o))
448         result = TS_DISABLED;
449     else if (isReadOnlyControl(o) && (TextFieldPart == appearance || TextAreaPart == appearance || SearchFieldPart == appearance))
450         result = TFS_READONLY; // Readonly is supported on textfields.
451     else if (isPressed(o)) // Active overrides hover and focused.
452         result = TS_ACTIVE;
453     else if (supportsFocus(appearance) && isFocused(o))
454         result = TS_FOCUSED;
455     else if (isHovered(o))
456         result = TS_HOVER;
457     if (isChecked(o))
458         result += 4; // 4 unchecked states, 4 checked states.
459     else if (isIndeterminate(o) && appearance == CheckboxPart)
460         result += 8;
461     return result;
462 }
463
464 unsigned RenderThemeWin::determineSliderThumbState(RenderObject* o)
465 {
466     unsigned result = TUS_NORMAL;
467     if (!isEnabled(o))
468         result = TUS_DISABLED;
469     else if (supportsFocus(o->style()->appearance()) && isFocused(o))
470         result = TUS_FOCUSED;
471     else if (isPressed(o))
472         result = TUS_PRESSED;
473     else if (isHovered(o))
474         result = TUS_HOT;
475     return result;
476 }
477
478 unsigned RenderThemeWin::determineButtonState(RenderObject* o)
479 {
480     unsigned result = PBS_NORMAL;
481     if (!isEnabled(o))
482         result = PBS_DISABLED;
483     else if (isPressed(o))
484         result = PBS_PRESSED;
485     else if (supportsFocus(o->style()->appearance()) && isFocused(o))
486         result = PBS_DEFAULTED;
487     else if (isHovered(o))
488         result = PBS_HOT;
489     else if (isDefault(o))
490         result = PBS_DEFAULTED;
491     return result;
492 }
493
494 unsigned RenderThemeWin::determineSpinButtonState(RenderObject* o, ControlSubPart subPart)
495 {
496     bool isUpButton = subPart == SpinButtonUp;
497     unsigned result = isUpButton ? UPS_NORMAL : DNS_NORMAL;
498     if (!isEnabled(o) || isReadOnlyControl(o))
499         result = isUpButton ? UPS_DISABLED : DNS_DISABLED;
500     else if (isPressed(o) && isUpButton == isSpinUpButtonPartPressed(o))
501         result = isUpButton ? UPS_PRESSED : DNS_PRESSED;
502     else if (isHovered(o) && isUpButton == isSpinUpButtonPartHovered(o))
503         result = isUpButton ? UPS_HOT : DNS_HOT;
504     return result;
505 }
506
507 ThemeData RenderThemeWin::getClassicThemeData(RenderObject* o, ControlSubPart subPart)
508 {
509     ThemeData result;
510     switch (o->style()->appearance()) {
511         case PushButtonPart:
512         case ButtonPart:
513         case DefaultButtonPart:
514         case CheckboxPart:
515         case RadioPart:
516             result.m_part = DFC_BUTTON;
517             result.m_state = determineClassicState(o);
518             break;
519         case MenulistPart:
520             result.m_part = DFC_SCROLL;
521             result.m_state = determineClassicState(o);
522             break;
523         case SearchFieldPart:
524         case TextFieldPart:
525         case TextAreaPart:
526             result.m_part = TFP_TEXTFIELD;
527             result.m_state = determineState(o);
528             break;
529         case SliderHorizontalPart:
530             result.m_part = TKP_TRACK;
531             result.m_state = TS_NORMAL;
532             break;
533         case SliderVerticalPart:
534             result.m_part = TKP_TRACKVERT;
535             result.m_state = TS_NORMAL;
536             break;
537         case SliderThumbHorizontalPart:
538             result.m_part = TKP_THUMBBOTTOM;
539             result.m_state = determineSliderThumbState(o);
540             break;
541         case SliderThumbVerticalPart:
542             result.m_part = TKP_THUMBRIGHT;
543             result.m_state = determineSliderThumbState(o);
544             break;
545         case InnerSpinButtonPart:
546             result.m_part = DFC_SCROLL;
547             result.m_state = determineClassicState(o, subPart);
548             break;
549         default:
550             break;
551     }
552     return result;
553 }
554
555 ThemeData RenderThemeWin::getThemeData(RenderObject* o, ControlSubPart subPart)
556 {
557     if (!haveTheme)
558         return getClassicThemeData(o, subPart);
559
560     ThemeData result;
561     switch (o->style()->appearance()) {
562         case PushButtonPart:
563         case ButtonPart:
564         case DefaultButtonPart:
565             result.m_part = BP_BUTTON;
566             result.m_state = determineButtonState(o);
567             break;
568         case CheckboxPart:
569             result.m_part = BP_CHECKBOX;
570             result.m_state = determineState(o);
571             break;
572         case MenulistPart:
573         case MenulistButtonPart: {
574             const bool isVistaOrLater = (windowsVersion() >= WindowsVista);
575             result.m_part = isVistaOrLater ? CP_DROPDOWNBUTTONRIGHT : CP_DROPDOWNBUTTON;
576             if (isVistaOrLater && documentIsInApplicationChromeMode(o->document())) {
577                 // The "readonly" look we use in application chrome mode
578                 // only uses a "normal" look for the drop down button.
579                 result.m_state = TS_NORMAL;
580             } else
581                 result.m_state = determineState(o);
582             break;
583         }
584         case RadioPart:
585             result.m_part = BP_RADIO;
586             result.m_state = determineState(o);
587             break;
588         case SearchFieldPart:
589         case TextFieldPart:
590         case TextAreaPart:
591             result.m_part = (windowsVersion() >= WindowsVista) ? EP_EDITBORDER_NOSCROLL : TFP_TEXTFIELD;
592             result.m_state = determineState(o);
593             break;
594         case SliderHorizontalPart:
595             result.m_part = TKP_TRACK;
596             result.m_state = TS_NORMAL;
597             break;
598         case SliderVerticalPart:
599             result.m_part = TKP_TRACKVERT;
600             result.m_state = TS_NORMAL;
601             break;
602         case SliderThumbHorizontalPart:
603             result.m_part = TKP_THUMBBOTTOM;
604             result.m_state = determineSliderThumbState(o);
605             break;
606         case SliderThumbVerticalPart:
607             result.m_part = TKP_THUMBRIGHT;
608             result.m_state = determineSliderThumbState(o);
609             break;
610         case InnerSpinButtonPart:
611             result.m_part = subPart == SpinButtonUp ? SPNP_UP : SPNP_DOWN;
612             result.m_state = determineSpinButtonState(o, subPart);
613             break;
614     }
615
616     return result;
617 }
618
619 static void drawControl(GraphicsContext* context, RenderObject* o, HANDLE theme, const ThemeData& themeData, const IntRect& r)
620 {
621     bool alphaBlend = false;
622     if (theme)
623         alphaBlend = IsThemeBackgroundPartiallyTransparent(theme, themeData.m_part, themeData.m_state);
624     LocalWindowsContext windowsContext(context, r, alphaBlend);
625     RECT widgetRect = r;
626     if (theme)
627         DrawThemeBackground(theme, windowsContext.hdc(), themeData.m_part, themeData.m_state, &widgetRect, 0);
628     else {
629         HDC hdc = windowsContext.hdc();
630         if (themeData.m_part == TFP_TEXTFIELD) {
631             ::DrawEdge(hdc, &widgetRect, EDGE_SUNKEN, BF_RECT | BF_ADJUST);
632             if (themeData.m_state == TS_DISABLED || themeData.m_state ==  TFS_READONLY)
633                 ::FillRect(hdc, &widgetRect, (HBRUSH)(COLOR_BTNFACE+1));
634             else
635                 ::FillRect(hdc, &widgetRect, (HBRUSH)(COLOR_WINDOW+1));
636         } else if (themeData.m_part == TKP_TRACK || themeData.m_part == TKP_TRACKVERT) {
637             ::DrawEdge(hdc, &widgetRect, EDGE_SUNKEN, BF_RECT | BF_ADJUST);
638             ::FillRect(hdc, &widgetRect, (HBRUSH)GetStockObject(GRAY_BRUSH));
639         } else if ((o->style()->appearance() == SliderThumbHorizontalPart ||
640                     o->style()->appearance() == SliderThumbVerticalPart) && 
641                    (themeData.m_part == TKP_THUMBBOTTOM || themeData.m_part == TKP_THUMBTOP || 
642                     themeData.m_part == TKP_THUMBLEFT || themeData.m_part == TKP_THUMBRIGHT)) {
643             ::DrawEdge(hdc, &widgetRect, EDGE_RAISED, BF_RECT | BF_SOFT | BF_MIDDLE | BF_ADJUST);
644             if (themeData.m_state == TUS_DISABLED) {
645                 static WORD patternBits[8] = {0xaa, 0x55, 0xaa, 0x55, 0xaa, 0x55, 0xaa, 0x55};
646                 HBITMAP patternBmp = ::CreateBitmap(8, 8, 1, 1, patternBits);
647                 if (patternBmp) {
648                     HBRUSH brush = (HBRUSH) ::CreatePatternBrush(patternBmp);
649                     COLORREF oldForeColor = ::SetTextColor(hdc, ::GetSysColor(COLOR_3DFACE));
650                     COLORREF oldBackColor = ::SetBkColor(hdc, ::GetSysColor(COLOR_3DHILIGHT));
651                     POINT p;
652                     ::GetViewportOrgEx(hdc, &p);
653                     ::SetBrushOrgEx(hdc, p.x + widgetRect.left, p.y + widgetRect.top, NULL);
654                     HBRUSH oldBrush = (HBRUSH) ::SelectObject(hdc, brush);
655                     ::FillRect(hdc, &widgetRect, brush);
656                     ::SetTextColor(hdc, oldForeColor);
657                     ::SetBkColor(hdc, oldBackColor);
658                     ::SelectObject(hdc, oldBrush);
659                     ::DeleteObject(brush); 
660                 } else
661                     ::FillRect(hdc, &widgetRect, (HBRUSH)COLOR_3DHILIGHT);
662                 ::DeleteObject(patternBmp);
663             }
664         } else {
665             // Push buttons, buttons, checkboxes and radios, and the dropdown arrow in menulists.
666             if (o->style()->appearance() == DefaultButtonPart) {
667                 HBRUSH brush = ::GetSysColorBrush(COLOR_3DDKSHADOW);
668                 ::FrameRect(hdc, &widgetRect, brush);
669                 ::InflateRect(&widgetRect, -1, -1);
670                 ::DrawEdge(hdc, &widgetRect, BDR_RAISEDOUTER, BF_RECT | BF_MIDDLE);
671             }
672             ::DrawFrameControl(hdc, &widgetRect, themeData.m_part, themeData.m_state);
673         }
674     }
675
676
677 #if !OS(WINCE)
678     if (!alphaBlend && !context->isInTransparencyLayer())
679         DIBPixelData::setRGBABitmapAlpha(windowsContext.hdc(), r, 255);
680 #endif
681 }
682
683 bool RenderThemeWin::paintButton(RenderObject* o, const PaintInfo& i, const IntRect& r)
684 {  
685     drawControl(i.context,  o, buttonTheme(), getThemeData(o), r);
686     return false;
687 }
688
689 void RenderThemeWin::adjustInnerSpinButtonStyle(StyleResolver* styleResolver, RenderStyle* style, Element* e) const
690 {
691     int width = ::GetSystemMetrics(SM_CXVSCROLL);
692     if (width <= 0)
693         width = 17; // Vista's default.
694     style->setWidth(Length(width, Fixed));
695     style->setMinWidth(Length(width, Fixed));
696 }
697
698 bool RenderThemeWin::paintInnerSpinButton(RenderObject* o, const PaintInfo& i, const IntRect& r)
699 {
700     // We split the specified rectangle into two vertically. We can't draw a
701     // spin button of which height is less than 2px.
702     if (r.height() < 2)
703         return false;
704     IntRect upRect(r);
705     upRect.setHeight(r.height() / 2);
706     IntRect downRect(r);
707     downRect.setY(upRect.maxY());
708     downRect.setHeight(r.height() - upRect.height());
709     drawControl(i.context, o, spinButtonTheme(), getThemeData(o, SpinButtonUp), upRect);
710     drawControl(i.context, o, spinButtonTheme(), getThemeData(o, SpinButtonDown), downRect);
711     return false;
712 }
713
714 void RenderThemeWin::setCheckboxSize(RenderStyle* style) const
715 {
716     // If the width and height are both specified, then we have nothing to do.
717     if (!style->width().isIntrinsicOrAuto() && !style->height().isAuto())
718         return;
719
720     // FIXME:  A hard-coded size of 13 is used.  This is wrong but necessary for now.  It matches Firefox.
721     // At different DPI settings on Windows, querying the theme gives you a larger size that accounts for
722     // the higher DPI.  Until our entire engine honors a DPI setting other than 96, we can't rely on the theme's
723     // metrics.
724     if (style->width().isIntrinsicOrAuto())
725         style->setWidth(Length(13, Fixed));
726     if (style->height().isAuto())
727         style->setHeight(Length(13, Fixed));
728 }
729
730 bool RenderThemeWin::paintTextField(RenderObject* o, const PaintInfo& i, const IntRect& r)
731 {
732     drawControl(i.context,  o, textFieldTheme(), getThemeData(o), r);
733     return false;
734 }
735
736 bool RenderThemeWin::paintMenuList(RenderObject* o, const PaintInfo& i, const IntRect& r)
737 {
738     HANDLE theme;
739     int part;
740     if (haveTheme && (windowsVersion() >= WindowsVista)) {
741         theme = menuListTheme();
742         if (documentIsInApplicationChromeMode(o->document()))
743             part = CP_READONLY;
744         else
745             part = CP_BORDER;
746     } else {
747         theme = textFieldTheme();
748         part = TFP_TEXTFIELD;
749     }
750
751     drawControl(i.context,  o, theme, ThemeData(part, determineState(o)), r);
752     
753     return paintMenuListButton(o, i, r);
754 }
755
756 void RenderThemeWin::adjustMenuListStyle(StyleResolver* styleResolver, RenderStyle* style, Element* e) const
757 {
758     style->resetBorder();
759     adjustMenuListButtonStyle(styleResolver, style, e);
760 }
761
762 void RenderThemeWin::adjustMenuListButtonStyle(StyleResolver* styleResolver, RenderStyle* style, Element* e) const
763 {
764     // These are the paddings needed to place the text correctly in the <select> box
765     const int dropDownBoxPaddingTop    = 2;
766     const int dropDownBoxPaddingRight  = style->direction() == LTR ? 4 + dropDownButtonWidth : 4;
767     const int dropDownBoxPaddingBottom = 2;
768     const int dropDownBoxPaddingLeft   = style->direction() == LTR ? 4 : 4 + dropDownButtonWidth;
769     // The <select> box must be at least 12px high for the button to render nicely on Windows
770     const int dropDownBoxMinHeight = 12;
771     
772     // Position the text correctly within the select box and make the box wide enough to fit the dropdown button
773     style->setPaddingTop(Length(dropDownBoxPaddingTop, Fixed));
774     style->setPaddingRight(Length(dropDownBoxPaddingRight, Fixed));
775     style->setPaddingBottom(Length(dropDownBoxPaddingBottom, Fixed));
776     style->setPaddingLeft(Length(dropDownBoxPaddingLeft, Fixed));
777
778     // Height is locked to auto
779     style->setHeight(Length(Auto));
780
781     // Calculate our min-height
782     int minHeight = style->fontMetrics().height();
783     minHeight = max(minHeight, dropDownBoxMinHeight);
784
785     style->setMinHeight(Length(minHeight, Fixed));
786
787     style->setLineHeight(RenderStyle::initialLineHeight());
788     
789     // White-space is locked to pre
790     style->setWhiteSpace(PRE);
791 }
792
793 bool RenderThemeWin::paintMenuListButton(RenderObject* o, const PaintInfo& i, const IntRect& r)
794 {
795     // FIXME: Don't make hardcoded assumptions about the thickness of the textfield border.
796     int borderThickness = haveTheme ? 1 : 2;
797
798     // Paint the dropdown button on the inner edge of the text field,
799     // leaving space for the text field's 1px border
800     IntRect buttonRect(r);
801     buttonRect.inflate(-borderThickness);
802     if (o->style()->direction() == LTR)
803         buttonRect.setX(buttonRect.maxX() - dropDownButtonWidth);
804     buttonRect.setWidth(dropDownButtonWidth);
805
806     if ((windowsVersion() >= WindowsVista)) {
807         // Outset the top, right, and bottom borders of the button so that they coincide with the <select>'s border.
808         buttonRect.setY(buttonRect.y() - vistaMenuListButtonOutset);
809         buttonRect.setHeight(buttonRect.height() + 2 * vistaMenuListButtonOutset);
810         buttonRect.setWidth(buttonRect.width() + vistaMenuListButtonOutset);
811     }
812
813     drawControl(i.context, o, menuListTheme(), getThemeData(o), buttonRect);
814
815     return false;
816 }
817
818 const int trackWidth = 4;
819
820 bool RenderThemeWin::paintSliderTrack(RenderObject* o, const PaintInfo& i, const IntRect& r)
821 {
822     IntRect bounds = r;
823     
824     if (o->style()->appearance() ==  SliderHorizontalPart) {
825         bounds.setHeight(trackWidth);
826         bounds.setY(r.y() + r.height() / 2 - trackWidth / 2);
827     } else if (o->style()->appearance() == SliderVerticalPart) {
828         bounds.setWidth(trackWidth);
829         bounds.setX(r.x() + r.width() / 2 - trackWidth / 2);
830     }
831     
832     drawControl(i.context,  o, sliderTheme(), getThemeData(o), bounds);
833     return false;
834 }
835
836 bool RenderThemeWin::paintSliderThumb(RenderObject* o, const PaintInfo& i, const IntRect& r)
837 {   
838     drawControl(i.context,  o, sliderTheme(), getThemeData(o), r);
839     return false;
840 }
841
842 const int sliderThumbWidth = 7;
843 const int sliderThumbHeight = 15;
844
845 void RenderThemeWin::adjustSliderThumbSize(RenderStyle* style, Element*) const
846 {
847     ControlPart part = style->appearance();
848     if (part == SliderThumbVerticalPart) {
849         style->setWidth(Length(sliderThumbHeight, Fixed));
850         style->setHeight(Length(sliderThumbWidth, Fixed));
851     } else if (part == SliderThumbHorizontalPart) {
852         style->setWidth(Length(sliderThumbWidth, Fixed));
853         style->setHeight(Length(sliderThumbHeight, Fixed));
854     }
855 #if ENABLE(VIDEO)
856     else if (part == MediaSliderThumbPart || part == MediaVolumeSliderThumbPart) 
857         RenderMediaControls::adjustMediaSliderThumbSize(style);
858 #endif
859 }
860
861 bool RenderThemeWin::paintSearchField(RenderObject* o, const PaintInfo& i, const IntRect& r)
862 {
863     return paintTextField(o, i, r);
864 }
865
866 void RenderThemeWin::adjustSearchFieldStyle(StyleResolver* styleResolver, RenderStyle* style, Element* e) const
867 {
868     // Override paddingSize to match AppKit text positioning.
869     const int padding = 1;
870     style->setPaddingLeft(Length(padding, Fixed));
871     style->setPaddingRight(Length(padding, Fixed));
872     style->setPaddingTop(Length(padding, Fixed));
873     style->setPaddingBottom(Length(padding, Fixed));
874     if (e && e->focused() && e->document()->frame()->selection()->isFocusedAndActive())
875         style->setOutlineOffset(-2);
876 }
877
878 bool RenderThemeWin::paintSearchFieldCancelButton(RenderObject* o, const PaintInfo& paintInfo, const IntRect& r)
879 {
880     IntRect bounds = r;
881     ASSERT(o->parent());
882     if (!o->parent() || !o->parent()->isBox())
883         return false;
884     
885     RenderBox* parentRenderBox = toRenderBox(o->parent());
886
887     IntRect parentBox = parentRenderBox->absoluteContentBox();
888     
889     // Make sure the scaled button stays square and will fit in its parent's box
890     bounds.setHeight(min(parentBox.width(), min(parentBox.height(), bounds.height())));
891     bounds.setWidth(bounds.height());
892
893     // Center the button vertically.  Round up though, so if it has to be one pixel off-center, it will
894     // be one pixel closer to the bottom of the field.  This tends to look better with the text.
895     bounds.setY(parentBox.y() + (parentBox.height() - bounds.height() + 1) / 2);
896
897     static Image* cancelImage = Image::loadPlatformResource("searchCancel").leakRef();
898     static Image* cancelPressedImage = Image::loadPlatformResource("searchCancelPressed").leakRef();
899     paintInfo.context->drawImage(isPressed(o) ? cancelPressedImage : cancelImage, o->style()->colorSpace(), bounds);
900     return false;
901 }
902
903 void RenderThemeWin::adjustSearchFieldCancelButtonStyle(StyleResolver*, RenderStyle* style, Element*) const
904 {
905     // Scale the button size based on the font size
906     float fontScale = style->fontSize() / defaultControlFontPixelSize;
907     int cancelButtonSize = lroundf(min(max(minCancelButtonSize, defaultCancelButtonSize * fontScale), maxCancelButtonSize));
908     style->setWidth(Length(cancelButtonSize, Fixed));
909     style->setHeight(Length(cancelButtonSize, Fixed));
910 }
911
912 void RenderThemeWin::adjustSearchFieldDecorationStyle(StyleResolver*, RenderStyle* style, Element*) const
913 {
914     IntSize emptySize(1, 11);
915     style->setWidth(Length(emptySize.width(), Fixed));
916     style->setHeight(Length(emptySize.height(), Fixed));
917 }
918
919 void RenderThemeWin::adjustSearchFieldResultsDecorationStyle(StyleResolver*, RenderStyle* style, Element*) const
920 {
921     // Scale the decoration size based on the font size
922     float fontScale = style->fontSize() / defaultControlFontPixelSize;
923     int magnifierSize = lroundf(min(max(minSearchFieldResultsDecorationSize, defaultSearchFieldResultsDecorationSize * fontScale), 
924                                      maxSearchFieldResultsDecorationSize));
925     style->setWidth(Length(magnifierSize, Fixed));
926     style->setHeight(Length(magnifierSize, Fixed));
927 }
928
929 bool RenderThemeWin::paintSearchFieldResultsDecoration(RenderObject* o, const PaintInfo& paintInfo, const IntRect& r)
930 {
931     IntRect bounds = r;
932     ASSERT(o->parent());
933     if (!o->parent() || !o->parent()->isBox())
934         return false;
935     
936     RenderBox* parentRenderBox = toRenderBox(o->parent());
937     IntRect parentBox = parentRenderBox->absoluteContentBox();
938     
939     // Make sure the scaled decoration stays square and will fit in its parent's box
940     bounds.setHeight(min(parentBox.width(), min(parentBox.height(), bounds.height())));
941     bounds.setWidth(bounds.height());
942
943     // Center the decoration vertically.  Round up though, so if it has to be one pixel off-center, it will
944     // be one pixel closer to the bottom of the field.  This tends to look better with the text.
945     bounds.setY(parentBox.y() + (parentBox.height() - bounds.height() + 1) / 2);
946     
947     static Image* magnifierImage = Image::loadPlatformResource("searchMagnifier").leakRef();
948     paintInfo.context->drawImage(magnifierImage, o->style()->colorSpace(), bounds);
949     return false;
950 }
951
952 void RenderThemeWin::adjustSearchFieldResultsButtonStyle(StyleResolver*, RenderStyle* style, Element*) const
953 {
954     // Scale the button size based on the font size
955     float fontScale = style->fontSize() / defaultControlFontPixelSize;
956     int magnifierHeight = lroundf(min(max(minSearchFieldResultsDecorationSize, defaultSearchFieldResultsDecorationSize * fontScale), 
957                                    maxSearchFieldResultsDecorationSize));
958     int magnifierWidth = lroundf(magnifierHeight * defaultSearchFieldResultsButtonWidth / defaultSearchFieldResultsDecorationSize);
959     style->setWidth(Length(magnifierWidth, Fixed));
960     style->setHeight(Length(magnifierHeight, Fixed));
961 }
962
963 bool RenderThemeWin::paintSearchFieldResultsButton(RenderObject* o, const PaintInfo& paintInfo, const IntRect& r)
964 {
965     IntRect bounds = r;
966     ASSERT(o->parent());
967     if (!o->parent())
968         return false;
969     if (!o->parent() || !o->parent()->isBox())
970         return false;
971     
972     RenderBox* parentRenderBox = toRenderBox(o->parent());
973     IntRect parentBox = parentRenderBox->absoluteContentBox();
974     
975     // Make sure the scaled decoration will fit in its parent's box
976     bounds.setHeight(min(parentBox.height(), bounds.height()));
977     bounds.setWidth(min<int>(parentBox.width(), bounds.height() * defaultSearchFieldResultsButtonWidth / defaultSearchFieldResultsDecorationSize));
978
979     // Center the button vertically.  Round up though, so if it has to be one pixel off-center, it will
980     // be one pixel closer to the bottom of the field.  This tends to look better with the text.
981     bounds.setY(parentBox.y() + (parentBox.height() - bounds.height() + 1) / 2);
982
983     static Image* magnifierImage = Image::loadPlatformResource("searchMagnifierResults").leakRef();
984     paintInfo.context->drawImage(magnifierImage, o->style()->colorSpace(), bounds);
985     return false;
986 }
987
988 // Map a CSSValue* system color to an index understood by GetSysColor
989 static int cssValueIdToSysColorIndex(int cssValueId)
990 {
991     switch (cssValueId) {
992         case CSSValueActiveborder: return COLOR_ACTIVEBORDER;
993         case CSSValueActivecaption: return COLOR_ACTIVECAPTION;
994         case CSSValueAppworkspace: return COLOR_APPWORKSPACE;
995         case CSSValueBackground: return COLOR_BACKGROUND;
996         case CSSValueButtonface: return COLOR_BTNFACE;
997         case CSSValueButtonhighlight: return COLOR_BTNHIGHLIGHT;
998         case CSSValueButtonshadow: return COLOR_BTNSHADOW;
999         case CSSValueButtontext: return COLOR_BTNTEXT;
1000         case CSSValueCaptiontext: return COLOR_CAPTIONTEXT;
1001         case CSSValueGraytext: return COLOR_GRAYTEXT;
1002         case CSSValueHighlight: return COLOR_HIGHLIGHT;
1003         case CSSValueHighlighttext: return COLOR_HIGHLIGHTTEXT;
1004         case CSSValueInactiveborder: return COLOR_INACTIVEBORDER;
1005         case CSSValueInactivecaption: return COLOR_INACTIVECAPTION;
1006         case CSSValueInactivecaptiontext: return COLOR_INACTIVECAPTIONTEXT;
1007         case CSSValueInfobackground: return COLOR_INFOBK;
1008         case CSSValueInfotext: return COLOR_INFOTEXT;
1009         case CSSValueMenu: return COLOR_MENU;
1010         case CSSValueMenutext: return COLOR_MENUTEXT;
1011         case CSSValueScrollbar: return COLOR_SCROLLBAR;
1012         case CSSValueThreeddarkshadow: return COLOR_3DDKSHADOW;
1013         case CSSValueThreedface: return COLOR_3DFACE;
1014         case CSSValueThreedhighlight: return COLOR_3DHIGHLIGHT;
1015         case CSSValueThreedlightshadow: return COLOR_3DLIGHT;
1016         case CSSValueThreedshadow: return COLOR_3DSHADOW;
1017         case CSSValueWindow: return COLOR_WINDOW;
1018         case CSSValueWindowframe: return COLOR_WINDOWFRAME;
1019         case CSSValueWindowtext: return COLOR_WINDOWTEXT;
1020         default: return -1; // Unsupported CSSValue
1021     }
1022 }
1023
1024 Color RenderThemeWin::systemColor(int cssValueId) const
1025 {
1026     int sysColorIndex = cssValueIdToSysColorIndex(cssValueId);
1027     if (sysColorIndex == -1)
1028         return RenderTheme::systemColor(cssValueId);
1029
1030     COLORREF color = GetSysColor(sysColorIndex);
1031     return Color(GetRValue(color), GetGValue(color), GetBValue(color));
1032 }
1033
1034 #if ENABLE(VIDEO)
1035
1036 String RenderThemeWin::extraMediaControlsStyleSheet()
1037 {
1038     return String(mediaControlsQuickTimeUserAgentStyleSheet, sizeof(mediaControlsQuickTimeUserAgentStyleSheet));
1039 }
1040
1041 #if ENABLE(FULLSCREEN_API)
1042 String RenderThemeWin::extraFullScreenStyleSheet()
1043 {
1044     return String(fullscreenQuickTimeUserAgentStyleSheet, sizeof(fullscreenQuickTimeUserAgentStyleSheet));
1045 }
1046 #endif
1047
1048 bool RenderThemeWin::supportsClosedCaptioning() const
1049 {
1050     return true;
1051 }
1052
1053 bool RenderThemeWin::paintMediaFullscreenButton(RenderObject* o, const PaintInfo& paintInfo, const IntRect& r)
1054 {
1055     return RenderMediaControls::paintMediaControlsPart(MediaEnterFullscreenButton, o, paintInfo, r);
1056 }
1057
1058 bool RenderThemeWin::paintMediaMuteButton(RenderObject* o, const PaintInfo& paintInfo, const IntRect& r)
1059 {
1060     return RenderMediaControls::paintMediaControlsPart(MediaMuteButton, o, paintInfo, r);
1061 }
1062
1063 bool RenderThemeWin::paintMediaPlayButton(RenderObject* o, const PaintInfo& paintInfo, const IntRect& r)
1064 {
1065     return RenderMediaControls::paintMediaControlsPart(MediaPlayButton, o, paintInfo, r);
1066 }
1067
1068 bool RenderThemeWin::paintMediaRewindButton(RenderObject* o, const PaintInfo& paintInfo, const IntRect& r)
1069 {
1070     return RenderMediaControls::paintMediaControlsPart(MediaRewindButton, o, paintInfo, r);
1071 }
1072
1073 bool RenderThemeWin::paintMediaSeekBackButton(RenderObject* o, const PaintInfo& paintInfo, const IntRect& r)
1074 {
1075     return RenderMediaControls::paintMediaControlsPart(MediaSeekBackButton, o, paintInfo, r);
1076 }
1077
1078 bool RenderThemeWin::paintMediaSeekForwardButton(RenderObject* o, const PaintInfo& paintInfo, const IntRect& r)
1079 {
1080     return RenderMediaControls::paintMediaControlsPart(MediaSeekForwardButton, o, paintInfo, r);
1081 }
1082
1083 bool RenderThemeWin::paintMediaSliderTrack(RenderObject* o, const PaintInfo& paintInfo, const IntRect& r)
1084 {
1085     return RenderMediaControls::paintMediaControlsPart(MediaSlider, o, paintInfo, r);
1086 }
1087
1088 bool RenderThemeWin::paintMediaSliderThumb(RenderObject* o, const PaintInfo& paintInfo, const IntRect& r)
1089 {
1090     return RenderMediaControls::paintMediaControlsPart(MediaSliderThumb, o, paintInfo, r);
1091 }
1092
1093 bool RenderThemeWin::paintMediaToggleClosedCaptionsButton(RenderObject* o, const PaintInfo& paintInfo, const IntRect& r)
1094 {
1095     return RenderMediaControls::paintMediaControlsPart(MediaShowClosedCaptionsButton, o, paintInfo, r);
1096 }
1097
1098 bool RenderThemeWin::paintMediaControlsBackground(RenderObject* o, const PaintInfo& paintInfo, const IntRect& r)
1099 {
1100     return RenderMediaControls::paintMediaControlsPart(MediaTimelineContainer, o, paintInfo, r);
1101 }
1102
1103 bool RenderThemeWin::paintMediaVolumeSliderContainer(RenderObject* o, const PaintInfo& paintInfo, const IntRect& r)
1104 {
1105     return RenderMediaControls::paintMediaControlsPart(MediaVolumeSliderContainer, o, paintInfo, r);
1106 }
1107
1108 bool RenderThemeWin::paintMediaVolumeSliderTrack(RenderObject* o, const PaintInfo& paintInfo, const IntRect& r)
1109 {
1110     return RenderMediaControls::paintMediaControlsPart(MediaVolumeSlider, o, paintInfo, r);
1111 }
1112
1113 bool RenderThemeWin::paintMediaVolumeSliderThumb(RenderObject* o, const PaintInfo& paintInfo, const IntRect& r)
1114 {
1115     return RenderMediaControls::paintMediaControlsPart(MediaVolumeSliderThumb, o, paintInfo, r);
1116 }
1117
1118 IntPoint RenderThemeWin::volumeSliderOffsetFromMuteButton(RenderBox* muteButtonBox, const IntSize& size) const
1119 {
1120     return RenderMediaControls::volumeSliderOffsetFromMuteButton(muteButtonBox, size);
1121 }
1122
1123
1124 #endif
1125
1126 }