Changeset 44776 in webkit
- Timestamp:
- Jun 17, 2009 12:18:10 PM (15 years ago)
- Location:
- trunk/WebCore
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebCore/ChangeLog
r44775 r44776 1 2009-06-17 Albert J. Wong <ajwong@chromium.org> 2 3 Reviewed by Eric Seidel. 4 5 https://bugs.webkit.org/show_bug.cgi?id=26148 6 Remove common code from RenderThemeChromiumWin that is shared with 7 RenderThemeChromiumSkia. 8 9 Also move supportsControlTints to RenderThemeChromiumLinux since it 10 is linux specific. 11 12 There are no tests changed because this just removes functions with 13 duplicate implementations between the base and derived classes. 14 15 * rendering/RenderThemeChromiumLinux.cpp: 16 (WebCore::RenderThemeChromiumLinux::supportsControlTints): 17 * rendering/RenderThemeChromiumLinux.h: 18 * rendering/RenderThemeChromiumSkia.cpp: 19 * rendering/RenderThemeChromiumSkia.h: 20 * rendering/RenderThemeChromiumWin.cpp: 21 (WebCore::): 22 (WebCore::getNonClientMetrics): 23 (WebCore::RenderThemeChromiumWin::RenderThemeChromiumWin): 24 (WebCore::RenderThemeChromiumWin::~RenderThemeChromiumWin): 25 (WebCore::RenderThemeChromiumWin::systemFont): 26 (WebCore::RenderThemeChromiumWin::paintCheckbox): 27 (WebCore::RenderThemeChromiumWin::paintRadio): 28 (WebCore::RenderThemeChromiumWin::paintSliderThumb): 29 (WebCore::RenderThemeChromiumWin::caretBlinkIntervalInternal): 30 * rendering/RenderThemeChromiumWin.h: 31 1 32 2009-06-17 Albert J. Wong <ajwong@chromium.org> 2 33 -
trunk/WebCore/rendering/RenderThemeChromiumLinux.cpp
r44775 r44776 86 86 } 87 87 88 bool RenderThemeChromiumLinux::supportsControlTints() const 89 { 90 return true; 91 } 92 88 93 } // namespace WebCore -
trunk/WebCore/rendering/RenderThemeChromiumLinux.h
r44775 r44776 53 53 RenderThemeChromiumLinux(); 54 54 virtual ~RenderThemeChromiumLinux(); 55 56 // A general method asking if any control tinting is supported at all. 57 virtual bool supportsControlTints() const; 55 58 }; 56 59 -
trunk/WebCore/rendering/RenderThemeChromiumSkia.cpp
r44775 r44776 163 163 } 164 164 165 Color RenderThemeChromiumSkia::platformTextSearchHighlightColor() const166 {167 return Color(0xff, 0xff, 0x96);168 }169 170 165 double RenderThemeChromiumSkia::caretBlinkInterval() const 171 166 { -
trunk/WebCore/rendering/RenderThemeChromiumSkia.h
r44775 r44776 55 55 virtual Color platformActiveSelectionForegroundColor() const; 56 56 virtual Color platformInactiveSelectionForegroundColor() const; 57 virtual Color platformTextSearchHighlightColor() const;58 57 59 58 // To change the blink interval, override caretBlinkIntervalInternal instead of this one so that we may share layout test code an intercepts. … … 118 117 virtual int buttonInternalPaddingBottom() const; 119 118 120 // A general method asking if any control tinting is supported at all.121 virtual bool supportsControlTints() const { return true; }122 123 119 protected: 124 120 static const String& defaultGUIFont(); -
trunk/WebCore/rendering/RenderThemeChromiumWin.cpp
r44758 r44776 31 31 32 32 #include "ChromiumBridge.h" 33 #include "CSSStyleSheet.h"34 33 #include "CSSValueKeywords.h" 35 34 #include "FontSelector.h" … … 42 41 #include "RenderSlider.h" 43 42 #include "ScrollbarTheme.h" 44 #include "SkiaUtils.h"45 43 #include "TransparencyWin.h" 46 #include "UserAgentStyleSheets.h"47 44 #include "WindowsVersion.h" 48 45 … … 59 56 60 57 namespace { 61 62 // The background for the media player controls should be a 60% opaque black rectangle. This63 // matches the UI mockups for the default UI theme.64 static const float defaultMediaControlOpacity = 0.6f;65 66 // These values all match Safari/Win.67 static const float defaultControlFontPixelSize = 13;68 static const float defaultCancelButtonSize = 9;69 static const float minCancelButtonSize = 5;70 static const float maxCancelButtonSize = 21;71 static const float defaultSearchFieldResultsDecorationSize = 13;72 static const float minSearchFieldResultsDecorationSize = 9;73 static const float maxSearchFieldResultsDecorationSize = 30;74 static const float defaultSearchFieldResultsButtonWidth = 18;75 76 bool canvasHasMultipleLayers(const SkCanvas* canvas)77 {78 SkCanvas::LayerIter iter(const_cast<SkCanvas*>(canvas), false);79 iter.next(); // There is always at least one layer.80 return !iter.done(); // There is > 1 layer if the the iterator can stil advance.81 }82 83 58 class ThemePainter : public TransparencyWin { 84 59 public: … … 95 70 96 71 private: 72 static bool canvasHasMultipleLayers(const SkCanvas* canvas) 73 { 74 SkCanvas::LayerIter iter(const_cast<SkCanvas*>(canvas), false); 75 iter.next(); // There is always at least one layer. 76 return !iter.done(); // There is > 1 layer if the the iterator can stil advance. 77 } 78 97 79 static LayerMode getLayerMode(GraphicsContext* context, TransformMode transformMode) 98 80 { … … 118 100 } // namespace 119 101 120 static void getNonClientMetrics(NONCLIENTMETRICS* metrics) { 102 static void getNonClientMetrics(NONCLIENTMETRICS* metrics) 103 { 121 104 static UINT size = WebCore::isVistaOrNewer() ? 122 105 sizeof(NONCLIENTMETRICS) : NONCLIENTMETRICS_SIZE_PRE_VISTA; … … 125 108 ASSERT(success); 126 109 } 127 128 enum PaddingType {129 TopPadding,130 RightPadding,131 BottomPadding,132 LeftPadding133 };134 135 static const int styledMenuListInternalPadding[4] = { 1, 4, 1, 4 };136 137 // The default variable-width font size. We use this as the default font138 // size for the "system font", and as a base size (which we then shrink) for139 // form control fonts.140 static float defaultFontSize = 16.0;141 110 142 111 static FontDescription smallSystemFont; … … 159 128 } 160 129 return false; 161 }162 163 static void setFixedPadding(RenderStyle* style, const int padding[4])164 {165 style->setPaddingLeft(Length(padding[LeftPadding], Fixed));166 style->setPaddingRight(Length(padding[RightPadding], Fixed));167 style->setPaddingTop(Length(padding[TopPadding], Fixed));168 style->setPaddingBottom(Length(padding[BottomPadding], Fixed));169 130 } 170 131 … … 203 164 } 204 165 205 // We aim to match IE here.206 // -IE uses a font based on the encoding as the default font for form controls.207 // -Gecko uses MS Shell Dlg (actually calls GetStockObject(DEFAULT_GUI_FONT),208 // which returns MS Shell Dlg)209 // -Safari uses Lucida Grande.210 //211 // FIXME: The only case where we know we don't match IE is for ANSI encodings.212 // IE uses MS Shell Dlg there, which we render incorrectly at certain pixel213 // sizes (e.g. 15px). So, for now we just use Arial.214 static wchar_t* defaultGUIFont()215 {216 return L"Arial";217 }218 219 166 // Converts |points| to pixels. One point is 1/72 of an inch. 220 167 static float pointsToPixels(float points) … … 235 182 } 236 183 237 static void setSizeIfAuto(RenderStyle* style, const IntSize& size)238 {239 if (style->width().isIntrinsicOrAuto())240 style->setWidth(Length(size.width(), Fixed));241 if (style->height().isAuto())242 style->setHeight(Length(size.height(), Fixed));243 }244 245 184 static double querySystemBlinkInterval(double defaultInterval) 246 185 { … … 253 192 } 254 193 255 #if ENABLE(VIDEO)256 // Attempt to retrieve a HTMLMediaElement from a Node. Returns NULL if one cannot be found.257 static HTMLMediaElement* mediaElementParent(Node* node)258 {259 if (!node)260 return 0;261 Node* mediaNode = node->shadowAncestorNode();262 if (!mediaNode || (!mediaNode->hasTagName(HTMLNames::videoTag) && !mediaNode->hasTagName(HTMLNames::audioTag)))263 return 0;264 265 return static_cast<HTMLMediaElement*>(mediaNode);266 }267 #endif268 269 194 PassRefPtr<RenderTheme> RenderThemeChromiumWin::create() 270 195 { … … 277 202 return rt; 278 203 } 279 280 String RenderThemeChromiumWin::extraDefaultStyleSheet()281 {282 return String(themeWinUserAgentStyleSheet, sizeof(themeWinUserAgentStyleSheet));283 }284 285 String RenderThemeChromiumWin::extraQuirksStyleSheet()286 {287 return String(themeWinQuirksUserAgentStyleSheet, sizeof(themeWinQuirksUserAgentStyleSheet));288 }289 290 #if ENABLE(VIDEO)291 String RenderThemeChromiumWin::extraMediaControlsStyleSheet()292 {293 return String(mediaControlsChromiumUserAgentStyleSheet, sizeof(mediaControlsChromiumUserAgentStyleSheet));294 }295 #endif296 204 297 205 bool RenderThemeChromiumWin::supportsFocusRing(const RenderStyle* style) const … … 343 251 } 344 252 345 double RenderThemeChromiumWin::caretBlinkInterval() const346 {347 // Disable the blinking caret in layout test mode, as it introduces348 // a race condition for the pixel tests. http://b/1198440349 if (ChromiumBridge::layoutTestMode())350 return 0;351 352 // This involves a system call, so we cache the result.353 static double blinkInterval = querySystemBlinkInterval(RenderTheme::caretBlinkInterval());354 return blinkInterval;355 }356 357 253 void RenderThemeChromiumWin::systemFont(int propId, FontDescription& fontDescription) const 358 254 { 359 255 // This logic owes much to RenderThemeSafari.cpp. 360 FontDescription* cachedDesc = NULL;361 wchar_t* faceName = 0;256 FontDescription* cachedDesc = 0; 257 AtomicString faceName; 362 258 float fontSize = 0; 363 259 switch (propId) { … … 367 263 NONCLIENTMETRICS metrics; 368 264 getNonClientMetrics(&metrics); 369 faceName = metrics.lfSmCaptionFont.lfFaceName;265 faceName = AtomicString(metrics.lfSmCaptionFont.lfFaceName, wcslen(metrics.lfSmCaptionFont.lfFaceName)); 370 266 fontSize = systemFontSize(metrics.lfSmCaptionFont); 371 267 } … … 376 272 NONCLIENTMETRICS metrics; 377 273 getNonClientMetrics(&metrics); 378 faceName = metrics.lfMenuFont.lfFaceName;274 faceName = AtomicString(metrics.lfMenuFont.lfFaceName, wcslen(metrics.lfMenuFont.lfFaceName)); 379 275 fontSize = systemFontSize(metrics.lfMenuFont); 380 276 } … … 406 302 407 303 if (fontSize) { 408 ASSERT(faceName); 409 cachedDesc->firstFamily().setFamily(AtomicString(faceName, 410 wcslen(faceName))); 304 cachedDesc->firstFamily().setFamily(faceName); 411 305 cachedDesc->setIsAbsoluteSize(true); 412 306 cachedDesc->setGenericFamily(FontDescription::NoFamily); … … 416 310 } 417 311 fontDescription = *cachedDesc; 418 }419 420 int RenderThemeChromiumWin::minimumMenuListSize(RenderStyle* style) const421 {422 return 0;423 312 } 424 313 … … 437 326 } 438 327 439 void RenderThemeChromiumWin::setCheckboxSize(RenderStyle* style) const 440 { 441 // If the width and height are both specified, then we have nothing to do. 442 if (!style->width().isIntrinsicOrAuto() && !style->height().isAuto()) 443 return; 444 445 // FIXME: A hard-coded size of 13 is used. This is wrong but necessary 446 // for now. It matches Firefox. At different DPI settings on Windows, 447 // querying the theme gives you a larger size that accounts for the higher 448 // DPI. Until our entire engine honors a DPI setting other than 96, we 449 // can't rely on the theme's metrics. 450 const IntSize size(13, 13); 451 setSizeIfAuto(style, size); 452 } 453 454 void RenderThemeChromiumWin::setRadioSize(RenderStyle* style) const 455 { 456 // Use same sizing for radio box as checkbox. 457 setCheckboxSize(style); 328 bool RenderThemeChromiumWin::paintCheckbox(RenderObject* o, const RenderObject::PaintInfo& i, const IntRect& r) 329 { 330 return paintButton(o, i, r); 331 } 332 bool RenderThemeChromiumWin::paintRadio(RenderObject* o, const RenderObject::PaintInfo& i, const IntRect& r) 333 { 334 return paintButton(o, i, r); 458 335 } 459 336 … … 489 366 } 490 367 491 void RenderThemeChromiumWin::adjustSearchFieldCancelButtonStyle(CSSStyleSelector*, RenderStyle* style, Element*) const 492 { 493 // Scale the button size based on the font size 494 float fontScale = style->fontSize() / defaultControlFontPixelSize; 495 int cancelButtonSize = lroundf(std::min(std::max(minCancelButtonSize, defaultCancelButtonSize * fontScale), maxCancelButtonSize)); 496 style->setWidth(Length(cancelButtonSize, Fixed)); 497 style->setHeight(Length(cancelButtonSize, Fixed)); 498 } 499 500 bool RenderThemeChromiumWin::paintSearchFieldCancelButton(RenderObject* o, const RenderObject::PaintInfo& i, const IntRect& r) 501 { 502 IntRect bounds = r; 503 ASSERT(o->parent()); 504 if (!o->parent() || !o->parent()->isBox()) 505 return false; 506 507 RenderBox* parentRenderBox = toRenderBox(o->parent()); 508 509 IntRect parentBox = parentRenderBox->absoluteContentBox(); 510 511 // Make sure the scaled button stays square and will fit in its parent's box 512 bounds.setHeight(std::min(parentBox.width(), std::min(parentBox.height(), bounds.height()))); 513 bounds.setWidth(bounds.height()); 514 515 // Center the button vertically. Round up though, so if it has to be one pixel off-center, it will 516 // be one pixel closer to the bottom of the field. This tends to look better with the text. 517 bounds.setY(parentBox.y() + (parentBox.height() - bounds.height() + 1) / 2); 518 519 static Image* cancelImage = Image::loadPlatformResource("searchCancel").releaseRef(); 520 static Image* cancelPressedImage = Image::loadPlatformResource("searchCancelPressed").releaseRef(); 521 i.context->drawImage(isPressed(o) ? cancelPressedImage : cancelImage, bounds); 522 return false; 523 } 524 525 void RenderThemeChromiumWin::adjustSearchFieldDecorationStyle(CSSStyleSelector*, RenderStyle* style, Element*) const 526 { 527 IntSize emptySize(1, 11); 528 style->setWidth(Length(emptySize.width(), Fixed)); 529 style->setHeight(Length(emptySize.height(), Fixed)); 530 } 531 532 void RenderThemeChromiumWin::adjustSearchFieldResultsDecorationStyle(CSSStyleSelector*, RenderStyle* style, Element*) const 533 { 534 // Scale the decoration size based on the font size 535 float fontScale = style->fontSize() / defaultControlFontPixelSize; 536 int magnifierSize = lroundf(std::min(std::max(minSearchFieldResultsDecorationSize, defaultSearchFieldResultsDecorationSize * fontScale), 537 maxSearchFieldResultsDecorationSize)); 538 style->setWidth(Length(magnifierSize, Fixed)); 539 style->setHeight(Length(magnifierSize, Fixed)); 540 } 541 542 bool RenderThemeChromiumWin::paintSearchFieldResultsDecoration(RenderObject* o, const RenderObject::PaintInfo& i, const IntRect& r) 543 { 544 IntRect bounds = r; 545 ASSERT(o->parent()); 546 if (!o->parent() || !o->parent()->isBox()) 547 return false; 548 549 RenderBox* parentRenderBox = toRenderBox(o->parent()); 550 IntRect parentBox = parentRenderBox->absoluteContentBox(); 551 552 // Make sure the scaled decoration stays square and will fit in its parent's box 553 bounds.setHeight(std::min(parentBox.width(), std::min(parentBox.height(), bounds.height()))); 554 bounds.setWidth(bounds.height()); 555 556 // Center the decoration vertically. Round up though, so if it has to be one pixel off-center, it will 557 // be one pixel closer to the bottom of the field. This tends to look better with the text. 558 bounds.setY(parentBox.y() + (parentBox.height() - bounds.height() + 1) / 2); 559 560 static Image* magnifierImage = Image::loadPlatformResource("searchMagnifier").releaseRef(); 561 i.context->drawImage(magnifierImage, bounds); 562 return false; 563 } 564 565 void RenderThemeChromiumWin::adjustSearchFieldResultsButtonStyle(CSSStyleSelector*, RenderStyle* style, Element*) const 566 { 567 // Scale the button size based on the font size 568 float fontScale = style->fontSize() / defaultControlFontPixelSize; 569 int magnifierHeight = lroundf(std::min(std::max(minSearchFieldResultsDecorationSize, defaultSearchFieldResultsDecorationSize * fontScale), 570 maxSearchFieldResultsDecorationSize)); 571 int magnifierWidth = lroundf(magnifierHeight * defaultSearchFieldResultsButtonWidth / defaultSearchFieldResultsDecorationSize); 572 style->setWidth(Length(magnifierWidth, Fixed)); 573 style->setHeight(Length(magnifierHeight, Fixed)); 574 } 575 576 bool RenderThemeChromiumWin::paintSearchFieldResultsButton(RenderObject* o, const RenderObject::PaintInfo& i, const IntRect& r) 577 { 578 IntRect bounds = r; 579 ASSERT(o->parent()); 580 if (!o->parent()) 581 return false; 582 if (!o->parent() || !o->parent()->isBox()) 583 return false; 584 585 RenderBox* parentRenderBox = toRenderBox(o->parent()); 586 IntRect parentBox = parentRenderBox->absoluteContentBox(); 587 588 // Make sure the scaled decoration will fit in its parent's box 589 bounds.setHeight(std::min(parentBox.height(), bounds.height())); 590 bounds.setWidth(std::min(parentBox.width(), static_cast<int>(bounds.height() * defaultSearchFieldResultsButtonWidth / defaultSearchFieldResultsDecorationSize))); 591 592 // Center the button vertically. Round up though, so if it has to be one pixel off-center, it will 593 // be one pixel closer to the bottom of the field. This tends to look better with the text. 594 bounds.setY(parentBox.y() + (parentBox.height() - bounds.height() + 1) / 2); 595 596 static Image* magnifierImage = Image::loadPlatformResource("searchMagnifierResults").releaseRef(); 597 i.context->drawImage(magnifierImage, bounds); 598 return false; 599 } 600 601 bool RenderThemeChromiumWin::paintMediaButtonInternal(GraphicsContext* context, const IntRect& rect, Image* image) 602 { 603 context->beginTransparencyLayer(defaultMediaControlOpacity); 604 605 // Draw background. 606 Color oldFill = context->fillColor(); 607 Color oldStroke = context->strokeColor(); 608 609 context->setFillColor(Color::black); 610 context->setStrokeColor(Color::black); 611 context->drawRect(rect); 612 613 context->setFillColor(oldFill); 614 context->setStrokeColor(oldStroke); 615 616 // Create a destination rectangle for the image that is centered in the drawing rectangle, rounded left, and down. 617 IntRect imageRect = image->rect(); 618 imageRect.setY(rect.y() + (rect.height() - image->height() + 1) / 2); 619 imageRect.setX(rect.x() + (rect.width() - image->width() + 1) / 2); 620 621 context->drawImage(image, imageRect, CompositeSourceAtop); 622 context->endTransparencyLayer(); 623 624 return false; 625 } 626 627 bool RenderThemeChromiumWin::paintMediaPlayButton(RenderObject* o, const RenderObject::PaintInfo& paintInfo, const IntRect& rect) 628 { 629 #if ENABLE(VIDEO) 630 HTMLMediaElement* mediaElement = mediaElementParent(o->node()); 631 if (!mediaElement) 632 return false; 633 634 static Image* mediaPlay = Image::loadPlatformResource("mediaPlay").releaseRef(); 635 static Image* mediaPause = Image::loadPlatformResource("mediaPause").releaseRef(); 636 637 return paintMediaButtonInternal(paintInfo.context, rect, mediaElement->paused() ? mediaPlay : mediaPause); 638 #else 639 return false; 640 #endif 641 } 642 643 bool RenderThemeChromiumWin::paintMediaMuteButton(RenderObject* o, const RenderObject::PaintInfo& paintInfo, const IntRect& rect) 644 { 645 #if ENABLE(VIDEO) 646 HTMLMediaElement* mediaElement = mediaElementParent(o->node()); 647 if (!mediaElement) 648 return false; 649 650 static Image* soundFull = Image::loadPlatformResource("mediaSoundFull").releaseRef(); 651 static Image* soundNone = Image::loadPlatformResource("mediaSoundNone").releaseRef(); 652 653 return paintMediaButtonInternal(paintInfo.context, rect, mediaElement->muted() ? soundNone: soundFull); 654 #else 655 return false; 656 #endif 657 } 658 659 void RenderThemeChromiumWin::adjustMenuListStyle(CSSStyleSelector* selector, RenderStyle* style, Element* e) const 660 { 661 // Height is locked to auto on all browsers. 662 style->setLineHeight(RenderStyle::initialLineHeight()); 368 bool RenderThemeChromiumWin::paintSliderThumb(RenderObject* o, const RenderObject::PaintInfo& i, const IntRect& r) 369 { 370 return paintSliderTrack(o, i, r); 663 371 } 664 372 … … 715 423 } 716 424 717 void RenderThemeChromiumWin::adjustMenuListButtonStyle(CSSStyleSelector* selector, RenderStyle* style, Element* e) const718 {719 adjustMenuListStyle(selector, style, e);720 }721 722 // Used to paint styled menulists (i.e. with a non-default border)723 bool RenderThemeChromiumWin::paintMenuListButton(RenderObject* o, const RenderObject::PaintInfo& i, const IntRect& r)724 {725 return paintMenuList(o, i, r);726 }727 728 int RenderThemeChromiumWin::popupInternalPaddingLeft(RenderStyle* style) const729 {730 return menuListInternalPadding(style, LeftPadding);731 }732 733 int RenderThemeChromiumWin::popupInternalPaddingRight(RenderStyle* style) const734 {735 return menuListInternalPadding(style, RightPadding);736 }737 738 int RenderThemeChromiumWin::popupInternalPaddingTop(RenderStyle* style) const739 {740 return menuListInternalPadding(style, TopPadding);741 }742 743 int RenderThemeChromiumWin::popupInternalPaddingBottom(RenderStyle* style) const744 {745 return menuListInternalPadding(style, BottomPadding);746 }747 748 int RenderThemeChromiumWin::buttonInternalPaddingLeft() const749 {750 return 3;751 }752 753 int RenderThemeChromiumWin::buttonInternalPaddingRight() const754 {755 return 3;756 }757 758 int RenderThemeChromiumWin::buttonInternalPaddingTop() const759 {760 return 1;761 }762 763 int RenderThemeChromiumWin::buttonInternalPaddingBottom() const764 {765 return 1;766 }767 768 425 // static 769 426 void RenderThemeChromiumWin::setDefaultFontSize(int fontSize) … … 773 430 // Reset cached fonts. 774 431 smallSystemFont = menuFont = labelFont = FontDescription(); 432 } 433 434 double RenderThemeChromiumWin::caretBlinkIntervalInternal() const 435 { 436 // This involves a system call, so we cache the result. 437 static double blinkInterval = querySystemBlinkInterval(RenderTheme::caretBlinkInterval()); 438 return blinkInterval; 775 439 } 776 440 … … 915 579 } 916 580 917 int RenderThemeChromiumWin::menuListInternalPadding(RenderStyle* style, int paddingType) const918 {919 // This internal padding is in addition to the user-supplied padding.920 // Matches the FF behavior.921 int padding = styledMenuListInternalPadding[paddingType];922 923 // Reserve the space for right arrow here. The rest of the padding is set924 // by adjustMenuListStyle, since PopupMenuChromium.cpp uses the padding925 // from RenderMenuList to lay out the individual items in the popup. If926 // the MenuList actually has appearance "NoAppearance", then that means we927 // don't draw a button, so don't reserve space for it.928 const int barType = style->direction() == LTR ? RightPadding : LeftPadding;929 if (paddingType == barType && style->appearance() != NoControlPart)930 padding += ScrollbarTheme::nativeTheme()->scrollbarThickness();931 932 return padding;933 }934 935 581 } // namespace WebCore -
trunk/WebCore/rendering/RenderThemeChromiumWin.h
r44758 r44776 25 25 #define RenderThemeChromiumWin_h 26 26 27 #include "RenderTheme .h"27 #include "RenderThemeChromiumSkia.h" 28 28 29 29 #if WIN32 … … 43 43 }; 44 44 45 class RenderThemeChromiumWin : public RenderTheme {45 class RenderThemeChromiumWin : public RenderThemeChromiumSkia { 46 46 public: 47 47 static PassRefPtr<RenderTheme> create(); 48 49 virtual String extraDefaultStyleSheet();50 virtual String extraQuirksStyleSheet();51 #if ENABLE(VIDEO)52 virtual String extraMediaControlsStyleSheet();53 #endif54 55 // A method asking if the theme's controls actually care about redrawing when hovered.56 virtual bool supportsHover(const RenderStyle*) const { return true; }57 48 58 49 // A method asking if the theme is able to draw the focus ring. … … 67 58 virtual Color platformInactiveTextSearchHighlightColor() const; 68 59 69 virtual double caretBlinkInterval() const;70 71 60 // System fonts. 72 61 virtual void systemFont(int propId, FontDescription&) const; 73 62 74 virtual int minimumMenuListSize(RenderStyle*) const;75 76 63 virtual void adjustSliderThumbSize(RenderObject*) const; 77 64 78 virtual bool paintCheckbox(RenderObject* o, const RenderObject::PaintInfo& i, const IntRect& r) { return paintButton(o, i, r); } 79 virtual void setCheckboxSize(RenderStyle*) const; 80 81 virtual bool paintRadio(RenderObject* o, const RenderObject::PaintInfo& i, const IntRect& r) { return paintButton(o, i, r); } 82 virtual void setRadioSize(RenderStyle*) const; 83 65 // Various paint functions. 66 virtual bool paintCheckbox(RenderObject*, const RenderObject::PaintInfo&, const IntRect&); 67 virtual bool paintRadio(RenderObject*, const RenderObject::PaintInfo&, const IntRect&); 84 68 virtual bool paintButton(RenderObject*, const RenderObject::PaintInfo&, const IntRect&); 85 86 69 virtual bool paintTextField(RenderObject*, const RenderObject::PaintInfo&, const IntRect&); 87 88 virtual bool paintTextArea(RenderObject* o, const RenderObject::PaintInfo& i, const IntRect& r) { return paintTextField(o, i, r); }89 90 70 virtual bool paintSliderTrack(RenderObject*, const RenderObject::PaintInfo&, const IntRect&); 91 92 virtual bool paintSliderThumb(RenderObject* o, const RenderObject::PaintInfo& i, const IntRect& r) { return paintSliderTrack(o, i, r); } 93 94 virtual bool paintSearchField(RenderObject* o, const RenderObject::PaintInfo& i, const IntRect& r) { return paintTextField(o, i, r); } 95 96 virtual void adjustSearchFieldCancelButtonStyle(CSSStyleSelector*, RenderStyle*, Element*) const; 97 virtual bool paintSearchFieldCancelButton(RenderObject*, const RenderObject::PaintInfo&, const IntRect&); 98 99 virtual void adjustSearchFieldDecorationStyle(CSSStyleSelector*, RenderStyle*, Element*) const; 100 101 virtual void adjustSearchFieldResultsDecorationStyle(CSSStyleSelector*, RenderStyle*, Element*) const; 102 virtual bool paintSearchFieldResultsDecoration(RenderObject*, const RenderObject::PaintInfo&, const IntRect&); 103 104 virtual void adjustSearchFieldResultsButtonStyle(CSSStyleSelector*, RenderStyle*, Element*) const; 105 virtual bool paintSearchFieldResultsButton(RenderObject*, const RenderObject::PaintInfo&, const IntRect&); 106 107 virtual bool paintMediaPlayButton(RenderObject*, const RenderObject::PaintInfo&, const IntRect&); 108 virtual bool paintMediaMuteButton(RenderObject*, const RenderObject::PaintInfo&, const IntRect&); 71 virtual bool paintSliderThumb(RenderObject*, const RenderObject::PaintInfo&, const IntRect&); 109 72 110 73 // MenuList refers to an unstyled menulist (meaning a menulist without … … 117 80 // codepath. We never go down both. And in both cases, they render the 118 81 // entire menulist. 119 virtual void adjustMenuListStyle(CSSStyleSelector*, RenderStyle*, Element*) const;120 82 virtual bool paintMenuList(RenderObject*, const RenderObject::PaintInfo&, const IntRect&); 121 virtual void adjustMenuListButtonStyle(CSSStyleSelector*, RenderStyle*, Element*) const;122 virtual bool paintMenuListButton(RenderObject*, const RenderObject::PaintInfo&, const IntRect&);123 124 // These methods define the padding for the MenuList's inner block.125 virtual int popupInternalPaddingLeft(RenderStyle*) const;126 virtual int popupInternalPaddingRight(RenderStyle*) const;127 virtual int popupInternalPaddingTop(RenderStyle*) const;128 virtual int popupInternalPaddingBottom(RenderStyle*) const;129 130 virtual int buttonInternalPaddingLeft() const;131 virtual int buttonInternalPaddingRight() const;132 virtual int buttonInternalPaddingTop() const;133 virtual int buttonInternalPaddingBottom() const;134 83 135 84 // Provide a way to pass the default font size from the Settings object … … 140 89 static void setDefaultFontSize(int); 141 90 91 protected: 92 virtual double caretBlinkIntervalInternal() const; 93 142 94 private: 143 RenderThemeChromiumWin() { }144 ~RenderThemeChromiumWin() { }95 RenderThemeChromiumWin(); 96 virtual ~RenderThemeChromiumWin(); 145 97 146 98 unsigned determineState(RenderObject*); … … 151 103 152 104 bool paintTextFieldInternal(RenderObject*, const RenderObject::PaintInfo&, const IntRect&, bool); 153 bool paintMediaButtonInternal(GraphicsContext*, const IntRect&, Image*);154 155 int menuListInternalPadding(RenderStyle*, int paddingType) const;156 105 }; 157 106
Note: See TracChangeset
for help on using the changeset viewer.