| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2007 Apple Inc. | 2 * Copyright (C) 2007 Apple Inc. |
| 3 * Copyright (C) 2007 Alp Toker <alp@atoker.com> | 3 * Copyright (C) 2007 Alp Toker <alp@atoker.com> |
| 4 * Copyright (C) 2008 Collabora Ltd. | 4 * Copyright (C) 2008 Collabora Ltd. |
| 5 * Copyright (C) 2008, 2009 Google Inc. | 5 * Copyright (C) 2008, 2009 Google Inc. |
| 6 * Copyright (C) 2009 Kenneth Rohde Christiansen | 6 * Copyright (C) 2009 Kenneth Rohde Christiansen |
| 7 * | 7 * |
| 8 * This library is free software; you can redistribute it and/or | 8 * This library is free software; you can redistribute it and/or |
| 9 * modify it under the terms of the GNU Library General Public | 9 * modify it under the terms of the GNU Library General Public |
| 10 * License as published by the Free Software Foundation; either | 10 * License as published by the Free Software Foundation; either |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 94 | 94 |
| 95 LayoutThemeDefault::LayoutThemeDefault() | 95 LayoutThemeDefault::LayoutThemeDefault() |
| 96 { | 96 { |
| 97 m_caretBlinkInterval = LayoutTheme::caretBlinkInterval(); | 97 m_caretBlinkInterval = LayoutTheme::caretBlinkInterval(); |
| 98 } | 98 } |
| 99 | 99 |
| 100 LayoutThemeDefault::~LayoutThemeDefault() | 100 LayoutThemeDefault::~LayoutThemeDefault() |
| 101 { | 101 { |
| 102 } | 102 } |
| 103 | 103 |
| 104 bool LayoutThemeDefault::supportsFocusRing(const LayoutStyle& style) const | 104 bool LayoutThemeDefault::supportsFocusRing(const ComputedStyle& style) const |
| 105 { | 105 { |
| 106 if (useMockTheme()) { | 106 if (useMockTheme()) { |
| 107 // Don't use focus rings for buttons when mocking controls. | 107 // Don't use focus rings for buttons when mocking controls. |
| 108 return style.appearance() == ButtonPart | 108 return style.appearance() == ButtonPart |
| 109 || style.appearance() == PushButtonPart | 109 || style.appearance() == PushButtonPart |
| 110 || style.appearance() == SquareButtonPart; | 110 || style.appearance() == SquareButtonPart; |
| 111 } | 111 } |
| 112 | 112 |
| 113 // This causes Blink to draw the focus rings for us. | 113 // This causes Blink to draw the focus rings for us. |
| 114 return false; | 114 return false; |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 209 return IntSize(1, 6); | 209 return IntSize(1, 6); |
| 210 } | 210 } |
| 211 | 211 |
| 212 int LayoutThemeDefault::sliderTickOffsetFromTrackCenter() const | 212 int LayoutThemeDefault::sliderTickOffsetFromTrackCenter() const |
| 213 { | 213 { |
| 214 if (useMockTheme()) | 214 if (useMockTheme()) |
| 215 return 11; | 215 return 11; |
| 216 return -16; | 216 return -16; |
| 217 } | 217 } |
| 218 | 218 |
| 219 void LayoutThemeDefault::adjustSliderThumbSize(LayoutStyle& style, Element* elem
ent) const | 219 void LayoutThemeDefault::adjustSliderThumbSize(ComputedStyle& style, Element* el
ement) const |
| 220 { | 220 { |
| 221 IntSize size = Platform::current()->themeEngine()->getSize(WebThemeEngine::P
artSliderThumb); | 221 IntSize size = Platform::current()->themeEngine()->getSize(WebThemeEngine::P
artSliderThumb); |
| 222 | 222 |
| 223 // FIXME: Mock theme doesn't handle zoomed sliders. | 223 // FIXME: Mock theme doesn't handle zoomed sliders. |
| 224 float zoomLevel = useMockTheme() ? 1 : style.effectiveZoom(); | 224 float zoomLevel = useMockTheme() ? 1 : style.effectiveZoom(); |
| 225 if (style.appearance() == SliderThumbHorizontalPart) { | 225 if (style.appearance() == SliderThumbHorizontalPart) { |
| 226 style.setWidth(Length(size.width() * zoomLevel, Fixed)); | 226 style.setWidth(Length(size.width() * zoomLevel, Fixed)); |
| 227 style.setHeight(Length(size.height() * zoomLevel, Fixed)); | 227 style.setHeight(Length(size.height() * zoomLevel, Fixed)); |
| 228 } else if (style.appearance() == SliderThumbVerticalPart) { | 228 } else if (style.appearance() == SliderThumbVerticalPart) { |
| 229 style.setWidth(Length(size.height() * zoomLevel, Fixed)); | 229 style.setWidth(Length(size.height() * zoomLevel, Fixed)); |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 266 unzoomedRect.setHeight(unzoomedRect.height() / zoomLevel); | 266 unzoomedRect.setHeight(unzoomedRect.height() / zoomLevel); |
| 267 i.context->translate(unzoomedRect.x(), unzoomedRect.y()); | 267 i.context->translate(unzoomedRect.x(), unzoomedRect.y()); |
| 268 i.context->scale(zoomLevel, zoomLevel); | 268 i.context->scale(zoomLevel, zoomLevel); |
| 269 i.context->translate(-unzoomedRect.x(), -unzoomedRect.y()); | 269 i.context->translate(-unzoomedRect.x(), -unzoomedRect.y()); |
| 270 } | 270 } |
| 271 | 271 |
| 272 Platform::current()->themeEngine()->paint(canvas, WebThemeEngine::PartCheckb
ox, getWebThemeState(this, o), WebRect(unzoomedRect), &extraParams); | 272 Platform::current()->themeEngine()->paint(canvas, WebThemeEngine::PartCheckb
ox, getWebThemeState(this, o), WebRect(unzoomedRect), &extraParams); |
| 273 return false; | 273 return false; |
| 274 } | 274 } |
| 275 | 275 |
| 276 void LayoutThemeDefault::setCheckboxSize(LayoutStyle& style) const | 276 void LayoutThemeDefault::setCheckboxSize(ComputedStyle& style) const |
| 277 { | 277 { |
| 278 // If the width and height are both specified, then we have nothing to do. | 278 // If the width and height are both specified, then we have nothing to do. |
| 279 if (!style.width().isIntrinsicOrAuto() && !style.height().isAuto()) | 279 if (!style.width().isIntrinsicOrAuto() && !style.height().isAuto()) |
| 280 return; | 280 return; |
| 281 | 281 |
| 282 IntSize size = Platform::current()->themeEngine()->getSize(WebThemeEngine::P
artCheckbox); | 282 IntSize size = Platform::current()->themeEngine()->getSize(WebThemeEngine::P
artCheckbox); |
| 283 float zoomLevel = style.effectiveZoom(); | 283 float zoomLevel = style.effectiveZoom(); |
| 284 size.setWidth(size.width() * zoomLevel); | 284 size.setWidth(size.width() * zoomLevel); |
| 285 size.setHeight(size.height() * zoomLevel); | 285 size.setHeight(size.height() * zoomLevel); |
| 286 setSizeIfAuto(style, size); | 286 setSizeIfAuto(style, size); |
| 287 } | 287 } |
| 288 | 288 |
| 289 bool LayoutThemeDefault::paintRadio(LayoutObject* o, const PaintInfo& i, const I
ntRect& rect) | 289 bool LayoutThemeDefault::paintRadio(LayoutObject* o, const PaintInfo& i, const I
ntRect& rect) |
| 290 { | 290 { |
| 291 WebThemeEngine::ExtraParams extraParams; | 291 WebThemeEngine::ExtraParams extraParams; |
| 292 WebCanvas* canvas = i.context->canvas(); | 292 WebCanvas* canvas = i.context->canvas(); |
| 293 extraParams.button.checked = isChecked(o); | 293 extraParams.button.checked = isChecked(o); |
| 294 | 294 |
| 295 Platform::current()->themeEngine()->paint(canvas, WebThemeEngine::PartRadio,
getWebThemeState(this, o), WebRect(rect), &extraParams); | 295 Platform::current()->themeEngine()->paint(canvas, WebThemeEngine::PartRadio,
getWebThemeState(this, o), WebRect(rect), &extraParams); |
| 296 return false; | 296 return false; |
| 297 } | 297 } |
| 298 | 298 |
| 299 void LayoutThemeDefault::setRadioSize(LayoutStyle& style) const | 299 void LayoutThemeDefault::setRadioSize(ComputedStyle& style) const |
| 300 { | 300 { |
| 301 // If the width and height are both specified, then we have nothing to do. | 301 // If the width and height are both specified, then we have nothing to do. |
| 302 if (!style.width().isIntrinsicOrAuto() && !style.height().isAuto()) | 302 if (!style.width().isIntrinsicOrAuto() && !style.height().isAuto()) |
| 303 return; | 303 return; |
| 304 | 304 |
| 305 IntSize size = Platform::current()->themeEngine()->getSize(WebThemeEngine::P
artRadio); | 305 IntSize size = Platform::current()->themeEngine()->getSize(WebThemeEngine::P
artRadio); |
| 306 float zoomLevel = style.effectiveZoom(); | 306 float zoomLevel = style.effectiveZoom(); |
| 307 size.setWidth(size.width() * zoomLevel); | 307 size.setWidth(size.width() * zoomLevel); |
| 308 size.setHeight(size.height() * zoomLevel); | 308 size.setHeight(size.height() * zoomLevel); |
| 309 setSizeIfAuto(style, size); | 309 setSizeIfAuto(style, size); |
| (...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 466 unzoomedRect.setHeight(unzoomedRect.height() / zoomLevel); | 466 unzoomedRect.setHeight(unzoomedRect.height() / zoomLevel); |
| 467 i.context->translate(unzoomedRect.x(), unzoomedRect.y()); | 467 i.context->translate(unzoomedRect.x(), unzoomedRect.y()); |
| 468 i.context->scale(zoomLevel, zoomLevel); | 468 i.context->scale(zoomLevel, zoomLevel); |
| 469 i.context->translate(-unzoomedRect.x(), -unzoomedRect.y()); | 469 i.context->translate(-unzoomedRect.x(), -unzoomedRect.y()); |
| 470 } | 470 } |
| 471 | 471 |
| 472 Platform::current()->themeEngine()->paint(canvas, WebThemeEngine::PartSlider
Thumb, getWebThemeState(this, o), WebRect(unzoomedRect), &extraParams); | 472 Platform::current()->themeEngine()->paint(canvas, WebThemeEngine::PartSlider
Thumb, getWebThemeState(this, o), WebRect(unzoomedRect), &extraParams); |
| 473 return false; | 473 return false; |
| 474 } | 474 } |
| 475 | 475 |
| 476 void LayoutThemeDefault::adjustInnerSpinButtonStyle(LayoutStyle& style, Element*
) const | 476 void LayoutThemeDefault::adjustInnerSpinButtonStyle(ComputedStyle& style, Elemen
t*) const |
| 477 { | 477 { |
| 478 IntSize size = Platform::current()->themeEngine()->getSize(WebThemeEngine::P
artInnerSpinButton); | 478 IntSize size = Platform::current()->themeEngine()->getSize(WebThemeEngine::P
artInnerSpinButton); |
| 479 | 479 |
| 480 style.setWidth(Length(size.width(), Fixed)); | 480 style.setWidth(Length(size.width(), Fixed)); |
| 481 style.setMinWidth(Length(size.width(), Fixed)); | 481 style.setMinWidth(Length(size.width(), Fixed)); |
| 482 } | 482 } |
| 483 | 483 |
| 484 bool LayoutThemeDefault::paintInnerSpinButton(LayoutObject* o, const PaintInfo&
i, const IntRect& rect) | 484 bool LayoutThemeDefault::paintInnerSpinButton(LayoutObject* o, const PaintInfo&
i, const IntRect& rect) |
| 485 { | 485 { |
| 486 WebThemeEngine::ExtraParams extraParams; | 486 WebThemeEngine::ExtraParams extraParams; |
| (...skipping 24 matching lines...) Expand all Loading... |
| 511 WebCanvas* canvas = i.context->canvas(); | 511 WebCanvas* canvas = i.context->canvas(); |
| 512 Platform::current()->themeEngine()->paint(canvas, WebThemeEngine::PartProgre
ssBar, getWebThemeState(this, o), WebRect(rect), &extraParams); | 512 Platform::current()->themeEngine()->paint(canvas, WebThemeEngine::PartProgre
ssBar, getWebThemeState(this, o), WebRect(rect), &extraParams); |
| 513 return false; | 513 return false; |
| 514 } | 514 } |
| 515 | 515 |
| 516 bool LayoutThemeDefault::shouldOpenPickerWithF4Key() const | 516 bool LayoutThemeDefault::shouldOpenPickerWithF4Key() const |
| 517 { | 517 { |
| 518 return true; | 518 return true; |
| 519 } | 519 } |
| 520 | 520 |
| 521 bool LayoutThemeDefault::shouldUseFallbackTheme(const LayoutStyle& style) const | 521 bool LayoutThemeDefault::shouldUseFallbackTheme(const ComputedStyle& style) cons
t |
| 522 { | 522 { |
| 523 if (useMockTheme()) { | 523 if (useMockTheme()) { |
| 524 // The mock theme can't handle zoomed controls, so we fall back to the "
fallback" theme. | 524 // The mock theme can't handle zoomed controls, so we fall back to the "
fallback" theme. |
| 525 ControlPart part = style.appearance(); | 525 ControlPart part = style.appearance(); |
| 526 if (part == CheckboxPart || part == RadioPart) | 526 if (part == CheckboxPart || part == RadioPart) |
| 527 return style.effectiveZoom() != 1; | 527 return style.effectiveZoom() != 1; |
| 528 } | 528 } |
| 529 return LayoutTheme::shouldUseFallbackTheme(style); | 529 return LayoutTheme::shouldUseFallbackTheme(style); |
| 530 } | 530 } |
| 531 | 531 |
| 532 bool LayoutThemeDefault::supportsHover(const LayoutStyle& style) const | 532 bool LayoutThemeDefault::supportsHover(const ComputedStyle& style) const |
| 533 { | 533 { |
| 534 return true; | 534 return true; |
| 535 } | 535 } |
| 536 | 536 |
| 537 Color LayoutThemeDefault::platformFocusRingColor() const | 537 Color LayoutThemeDefault::platformFocusRingColor() const |
| 538 { | 538 { |
| 539 static Color focusRingColor(229, 151, 0, 255); | 539 static Color focusRingColor(229, 151, 0, 255); |
| 540 return focusRingColor; | 540 return focusRingColor; |
| 541 } | 541 } |
| 542 | 542 |
| 543 double LayoutThemeDefault::caretBlinkInterval() const | 543 double LayoutThemeDefault::caretBlinkInterval() const |
| 544 { | 544 { |
| 545 // Disable the blinking caret in layout test mode, as it introduces | 545 // Disable the blinking caret in layout test mode, as it introduces |
| 546 // a race condition for the pixel tests. http://b/1198440 | 546 // a race condition for the pixel tests. http://b/1198440 |
| 547 if (LayoutTestSupport::isRunningLayoutTest()) | 547 if (LayoutTestSupport::isRunningLayoutTest()) |
| 548 return 0; | 548 return 0; |
| 549 | 549 |
| 550 return m_caretBlinkInterval; | 550 return m_caretBlinkInterval; |
| 551 } | 551 } |
| 552 | 552 |
| 553 void LayoutThemeDefault::systemFont(CSSValueID systemFontID, FontStyle& fontStyl
e, FontWeight& fontWeight, float& fontSize, AtomicString& fontFamily) const | 553 void LayoutThemeDefault::systemFont(CSSValueID systemFontID, FontStyle& fontStyl
e, FontWeight& fontWeight, float& fontSize, AtomicString& fontFamily) const |
| 554 { | 554 { |
| 555 LayoutThemeFontProvider::systemFont(systemFontID, fontStyle, fontWeight, fon
tSize, fontFamily); | 555 LayoutThemeFontProvider::systemFont(systemFontID, fontStyle, fontWeight, fon
tSize, fontFamily); |
| 556 } | 556 } |
| 557 | 557 |
| 558 int LayoutThemeDefault::minimumMenuListSize(const LayoutStyle& style) const | 558 int LayoutThemeDefault::minimumMenuListSize(const ComputedStyle& style) const |
| 559 { | 559 { |
| 560 return 0; | 560 return 0; |
| 561 } | 561 } |
| 562 | 562 |
| 563 // Return a rectangle that has the same center point as |original|, but with a | 563 // Return a rectangle that has the same center point as |original|, but with a |
| 564 // size capped at |width| by |height|. | 564 // size capped at |width| by |height|. |
| 565 IntRect center(const IntRect& original, int width, int height) | 565 IntRect center(const IntRect& original, int width, int height) |
| 566 { | 566 { |
| 567 width = std::min(original.width(), width); | 567 width = std::min(original.width(), width); |
| 568 height = std::min(original.height(), height); | 568 height = std::min(original.height(), height); |
| 569 int x = original.x() + (original.width() - width) / 2; | 569 int x = original.x() + (original.width() - width) / 2; |
| 570 int y = original.y() + (original.height() - height) / 2; | 570 int y = original.y() + (original.height() - height) / 2; |
| 571 | 571 |
| 572 return IntRect(x, y, width, height); | 572 return IntRect(x, y, width, height); |
| 573 } | 573 } |
| 574 | 574 |
| 575 void LayoutThemeDefault::adjustButtonStyle(LayoutStyle& style, Element*) const | 575 void LayoutThemeDefault::adjustButtonStyle(ComputedStyle& style, Element*) const |
| 576 { | 576 { |
| 577 if (style.appearance() == PushButtonPart) { | 577 if (style.appearance() == PushButtonPart) { |
| 578 // Ignore line-height. | 578 // Ignore line-height. |
| 579 style.setLineHeight(LayoutStyle::initialLineHeight()); | 579 style.setLineHeight(ComputedStyle::initialLineHeight()); |
| 580 } | 580 } |
| 581 } | 581 } |
| 582 | 582 |
| 583 bool LayoutThemeDefault::paintTextArea(LayoutObject* o, const PaintInfo& i, cons
t IntRect& r) | 583 bool LayoutThemeDefault::paintTextArea(LayoutObject* o, const PaintInfo& i, cons
t IntRect& r) |
| 584 { | 584 { |
| 585 return paintTextField(o, i, r); | 585 return paintTextField(o, i, r); |
| 586 } | 586 } |
| 587 | 587 |
| 588 void LayoutThemeDefault::adjustSearchFieldStyle(LayoutStyle& style, Element*) co
nst | 588 void LayoutThemeDefault::adjustSearchFieldStyle(ComputedStyle& style, Element*)
const |
| 589 { | 589 { |
| 590 // Ignore line-height. | 590 // Ignore line-height. |
| 591 style.setLineHeight(LayoutStyle::initialLineHeight()); | 591 style.setLineHeight(ComputedStyle::initialLineHeight()); |
| 592 } | 592 } |
| 593 | 593 |
| 594 bool LayoutThemeDefault::paintSearchField(LayoutObject* o, const PaintInfo& i, c
onst IntRect& r) | 594 bool LayoutThemeDefault::paintSearchField(LayoutObject* o, const PaintInfo& i, c
onst IntRect& r) |
| 595 { | 595 { |
| 596 return paintTextField(o, i, r); | 596 return paintTextField(o, i, r); |
| 597 } | 597 } |
| 598 | 598 |
| 599 void LayoutThemeDefault::adjustSearchFieldCancelButtonStyle(LayoutStyle& style,
Element*) const | 599 void LayoutThemeDefault::adjustSearchFieldCancelButtonStyle(ComputedStyle& style
, Element*) const |
| 600 { | 600 { |
| 601 // Scale the button size based on the font size | 601 // Scale the button size based on the font size |
| 602 float fontScale = style.fontSize() / defaultControlFontPixelSize; | 602 float fontScale = style.fontSize() / defaultControlFontPixelSize; |
| 603 int cancelButtonSize = lroundf(std::min(std::max(minCancelButtonSize, defaul
tCancelButtonSize * fontScale), maxCancelButtonSize)); | 603 int cancelButtonSize = lroundf(std::min(std::max(minCancelButtonSize, defaul
tCancelButtonSize * fontScale), maxCancelButtonSize)); |
| 604 style.setWidth(Length(cancelButtonSize, Fixed)); | 604 style.setWidth(Length(cancelButtonSize, Fixed)); |
| 605 style.setHeight(Length(cancelButtonSize, Fixed)); | 605 style.setHeight(Length(cancelButtonSize, Fixed)); |
| 606 } | 606 } |
| 607 | 607 |
| 608 IntRect LayoutThemeDefault::convertToPaintingRect(LayoutObject* inputRenderer, c
onst LayoutObject* partRenderer, LayoutRect partRect, const IntRect& localOffset
) const | 608 IntRect LayoutThemeDefault::convertToPaintingRect(LayoutObject* inputRenderer, c
onst LayoutObject* partRenderer, LayoutRect partRect, const IntRect& localOffset
) const |
| 609 { | 609 { |
| (...skipping 28 matching lines...) Expand all Loading... |
| 638 inputContentBox.y() + (inputContentBox.height() - cancelButtonSize + 1)
/ 2, | 638 inputContentBox.y() + (inputContentBox.height() - cancelButtonSize + 1)
/ 2, |
| 639 cancelButtonSize, cancelButtonSize); | 639 cancelButtonSize, cancelButtonSize); |
| 640 IntRect paintingRect = convertToPaintingRect(inputLayoutBox, cancelButtonObj
ect, cancelButtonRect, r); | 640 IntRect paintingRect = convertToPaintingRect(inputLayoutBox, cancelButtonObj
ect, cancelButtonRect, r); |
| 641 | 641 |
| 642 DEFINE_STATIC_REF(Image, cancelImage, (Image::loadPlatformResource("searchCa
ncel"))); | 642 DEFINE_STATIC_REF(Image, cancelImage, (Image::loadPlatformResource("searchCa
ncel"))); |
| 643 DEFINE_STATIC_REF(Image, cancelPressedImage, (Image::loadPlatformResource("s
earchCancelPressed"))); | 643 DEFINE_STATIC_REF(Image, cancelPressedImage, (Image::loadPlatformResource("s
earchCancelPressed"))); |
| 644 paintInfo.context->drawImage(isPressed(cancelButtonObject) ? cancelPressedIm
age : cancelImage, paintingRect); | 644 paintInfo.context->drawImage(isPressed(cancelButtonObject) ? cancelPressedIm
age : cancelImage, paintingRect); |
| 645 return false; | 645 return false; |
| 646 } | 646 } |
| 647 | 647 |
| 648 void LayoutThemeDefault::adjustSearchFieldDecorationStyle(LayoutStyle& style, El
ement*) const | 648 void LayoutThemeDefault::adjustSearchFieldDecorationStyle(ComputedStyle& style,
Element*) const |
| 649 { | 649 { |
| 650 IntSize emptySize(1, 11); | 650 IntSize emptySize(1, 11); |
| 651 style.setWidth(Length(emptySize.width(), Fixed)); | 651 style.setWidth(Length(emptySize.width(), Fixed)); |
| 652 style.setHeight(Length(emptySize.height(), Fixed)); | 652 style.setHeight(Length(emptySize.height(), Fixed)); |
| 653 } | 653 } |
| 654 | 654 |
| 655 void LayoutThemeDefault::adjustSearchFieldResultsDecorationStyle(LayoutStyle& st
yle, Element*) const | 655 void LayoutThemeDefault::adjustSearchFieldResultsDecorationStyle(ComputedStyle&
style, Element*) const |
| 656 { | 656 { |
| 657 // Scale the decoration size based on the font size | 657 // Scale the decoration size based on the font size |
| 658 float fontScale = style.fontSize() / defaultControlFontPixelSize; | 658 float fontScale = style.fontSize() / defaultControlFontPixelSize; |
| 659 int magnifierSize = lroundf(std::min(std::max(minSearchFieldResultsDecoratio
nSize, defaultSearchFieldResultsDecorationSize * fontScale), | 659 int magnifierSize = lroundf(std::min(std::max(minSearchFieldResultsDecoratio
nSize, defaultSearchFieldResultsDecorationSize * fontScale), |
| 660 maxSearchFieldResultsDecorationSize)); | 660 maxSearchFieldResultsDecorationSize)); |
| 661 style.setWidth(Length(magnifierSize, Fixed)); | 661 style.setWidth(Length(magnifierSize, Fixed)); |
| 662 style.setHeight(Length(magnifierSize, Fixed)); | 662 style.setHeight(Length(magnifierSize, Fixed)); |
| 663 } | 663 } |
| 664 | 664 |
| 665 bool LayoutThemeDefault::paintSearchFieldResultsDecoration(LayoutObject* magnifi
erObject, const PaintInfo& paintInfo, const IntRect& r) | 665 bool LayoutThemeDefault::paintSearchFieldResultsDecoration(LayoutObject* magnifi
erObject, const PaintInfo& paintInfo, const IntRect& r) |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 742 String LayoutThemeDefault::formatMediaControlsCurrentTime(float currentTime, flo
at duration) const | 742 String LayoutThemeDefault::formatMediaControlsCurrentTime(float currentTime, flo
at duration) const |
| 743 { | 743 { |
| 744 return LayoutMediaControls::formatMediaControlsCurrentTime(currentTime, dura
tion); | 744 return LayoutMediaControls::formatMediaControlsCurrentTime(currentTime, dura
tion); |
| 745 } | 745 } |
| 746 | 746 |
| 747 bool LayoutThemeDefault::paintMediaFullscreenButton(LayoutObject* object, const
PaintInfo& paintInfo, const IntRect& rect) | 747 bool LayoutThemeDefault::paintMediaFullscreenButton(LayoutObject* object, const
PaintInfo& paintInfo, const IntRect& rect) |
| 748 { | 748 { |
| 749 return LayoutMediaControls::paintMediaControlsPart(MediaEnterFullscreenButto
n, object, paintInfo, rect); | 749 return LayoutMediaControls::paintMediaControlsPart(MediaEnterFullscreenButto
n, object, paintInfo, rect); |
| 750 } | 750 } |
| 751 | 751 |
| 752 void LayoutThemeDefault::adjustMenuListStyle(LayoutStyle& style, Element*) const | 752 void LayoutThemeDefault::adjustMenuListStyle(ComputedStyle& style, Element*) con
st |
| 753 { | 753 { |
| 754 // Height is locked to auto on all browsers. | 754 // Height is locked to auto on all browsers. |
| 755 style.setLineHeight(LayoutStyle::initialLineHeight()); | 755 style.setLineHeight(ComputedStyle::initialLineHeight()); |
| 756 } | 756 } |
| 757 | 757 |
| 758 void LayoutThemeDefault::adjustMenuListButtonStyle(LayoutStyle& style, Element*
e) const | 758 void LayoutThemeDefault::adjustMenuListButtonStyle(ComputedStyle& style, Element
* e) const |
| 759 { | 759 { |
| 760 adjustMenuListStyle(style, e); | 760 adjustMenuListStyle(style, e); |
| 761 } | 761 } |
| 762 | 762 |
| 763 int LayoutThemeDefault::popupInternalPaddingLeft(const LayoutStyle& style) const | 763 int LayoutThemeDefault::popupInternalPaddingLeft(const ComputedStyle& style) con
st |
| 764 { | 764 { |
| 765 return menuListInternalPadding(style, LeftPadding); | 765 return menuListInternalPadding(style, LeftPadding); |
| 766 } | 766 } |
| 767 | 767 |
| 768 int LayoutThemeDefault::popupInternalPaddingRight(const LayoutStyle& style) cons
t | 768 int LayoutThemeDefault::popupInternalPaddingRight(const ComputedStyle& style) co
nst |
| 769 { | 769 { |
| 770 return menuListInternalPadding(style, RightPadding); | 770 return menuListInternalPadding(style, RightPadding); |
| 771 } | 771 } |
| 772 | 772 |
| 773 int LayoutThemeDefault::popupInternalPaddingTop(const LayoutStyle& style) const | 773 int LayoutThemeDefault::popupInternalPaddingTop(const ComputedStyle& style) cons
t |
| 774 { | 774 { |
| 775 return menuListInternalPadding(style, TopPadding); | 775 return menuListInternalPadding(style, TopPadding); |
| 776 } | 776 } |
| 777 | 777 |
| 778 int LayoutThemeDefault::popupInternalPaddingBottom(const LayoutStyle& style) con
st | 778 int LayoutThemeDefault::popupInternalPaddingBottom(const ComputedStyle& style) c
onst |
| 779 { | 779 { |
| 780 return menuListInternalPadding(style, BottomPadding); | 780 return menuListInternalPadding(style, BottomPadding); |
| 781 } | 781 } |
| 782 | 782 |
| 783 // static | 783 // static |
| 784 void LayoutThemeDefault::setDefaultFontSize(int fontSize) | 784 void LayoutThemeDefault::setDefaultFontSize(int fontSize) |
| 785 { | 785 { |
| 786 LayoutThemeFontProvider::setDefaultFontSize(fontSize); | 786 LayoutThemeFontProvider::setDefaultFontSize(fontSize); |
| 787 } | 787 } |
| 788 | 788 |
| 789 int LayoutThemeDefault::menuListArrowPadding() const | 789 int LayoutThemeDefault::menuListArrowPadding() const |
| 790 { | 790 { |
| 791 return ScrollbarTheme::theme()->scrollbarThickness(); | 791 return ScrollbarTheme::theme()->scrollbarThickness(); |
| 792 } | 792 } |
| 793 | 793 |
| 794 int LayoutThemeDefault::menuListInternalPadding(const LayoutStyle& style, int pa
ddingType) const | 794 int LayoutThemeDefault::menuListInternalPadding(const ComputedStyle& style, int
paddingType) const |
| 795 { | 795 { |
| 796 // This internal padding is in addition to the user-supplied padding. | 796 // This internal padding is in addition to the user-supplied padding. |
| 797 // Matches the FF behavior. | 797 // Matches the FF behavior. |
| 798 int padding = styledMenuListInternalPadding[paddingType]; | 798 int padding = styledMenuListInternalPadding[paddingType]; |
| 799 | 799 |
| 800 // Reserve the space for right arrow here. The rest of the padding is | 800 // Reserve the space for right arrow here. The rest of the padding is |
| 801 // set by adjustMenuListStyle, since PopMenuWin.cpp uses the padding from | 801 // set by adjustMenuListStyle, since PopMenuWin.cpp uses the padding from |
| 802 // LayoutMenuList to lay out the individual items in the popup. | 802 // LayoutMenuList to lay out the individual items in the popup. |
| 803 // If the MenuList actually has appearance "NoAppearance", then that means | 803 // If the MenuList actually has appearance "NoAppearance", then that means |
| 804 // we don't draw a button, so don't reserve space for it. | 804 // we don't draw a button, so don't reserve space for it. |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 868 } | 868 } |
| 869 | 869 |
| 870 LayoutThemeDefault::DirectionFlippingScope::~DirectionFlippingScope() | 870 LayoutThemeDefault::DirectionFlippingScope::~DirectionFlippingScope() |
| 871 { | 871 { |
| 872 if (!m_needsFlipping) | 872 if (!m_needsFlipping) |
| 873 return; | 873 return; |
| 874 m_paintInfo.context->restore(); | 874 m_paintInfo.context->restore(); |
| 875 } | 875 } |
| 876 | 876 |
| 877 } // namespace blink | 877 } // namespace blink |
| OLD | NEW |