diff options
author | Steve Block <steveblock@google.com> | 2010-02-05 14:27:46 +0000 |
---|---|---|
committer | Steve Block <steveblock@google.com> | 2010-02-15 10:49:50 +0000 |
commit | 5e2bc6953fe6923165b8a5d7679939693a1d58d6 (patch) | |
tree | 6ccb8c24bc2bf5e8f413e6cfae250b729b426631 /WebCore/rendering | |
parent | 4a00f4fccc3cb7e9996749a05631f5d7b9de756e (diff) | |
download | external_webkit-5e2bc6953fe6923165b8a5d7679939693a1d58d6.zip external_webkit-5e2bc6953fe6923165b8a5d7679939693a1d58d6.tar.gz external_webkit-5e2bc6953fe6923165b8a5d7679939693a1d58d6.tar.bz2 |
Merge webkit.org at r54340 : Initial merge by git
Change-Id: Ib489d2ff91186ea3652522e1d586e54416a2cf44
Diffstat (limited to 'WebCore/rendering')
-rw-r--r-- | WebCore/rendering/MediaControlElements.cpp | 23 | ||||
-rw-r--r-- | WebCore/rendering/MediaControlElements.h | 2 | ||||
-rw-r--r-- | WebCore/rendering/RenderBoxModelObject.cpp | 2 | ||||
-rw-r--r-- | WebCore/rendering/RenderCounter.cpp | 3 | ||||
-rw-r--r-- | WebCore/rendering/RenderFieldset.cpp | 3 | ||||
-rw-r--r-- | WebCore/rendering/RenderImage.h | 4 | ||||
-rw-r--r-- | WebCore/rendering/RenderMedia.cpp | 5 | ||||
-rw-r--r-- | WebCore/rendering/RenderTable.cpp | 3 | ||||
-rw-r--r-- | WebCore/rendering/RenderTableCell.cpp | 6 | ||||
-rw-r--r-- | WebCore/rendering/RenderTextControlMultiLine.cpp | 2 | ||||
-rw-r--r-- | WebCore/rendering/RenderTheme.cpp | 29 | ||||
-rw-r--r-- | WebCore/rendering/RenderTheme.h | 3 | ||||
-rw-r--r-- | WebCore/rendering/RenderThemeChromiumLinux.cpp | 4 | ||||
-rw-r--r-- | WebCore/rendering/RenderThemeChromiumLinux.h | 4 | ||||
-rw-r--r-- | WebCore/rendering/RenderThemeChromiumMac.h | 1 | ||||
-rw-r--r-- | WebCore/rendering/RenderThemeChromiumMac.mm | 97 | ||||
-rw-r--r-- | WebCore/rendering/RenderVideo.cpp | 4 |
17 files changed, 112 insertions, 83 deletions
diff --git a/WebCore/rendering/MediaControlElements.cpp b/WebCore/rendering/MediaControlElements.cpp index 9c56756..2b7a8c8 100644 --- a/WebCore/rendering/MediaControlElements.cpp +++ b/WebCore/rendering/MediaControlElements.cpp @@ -504,7 +504,7 @@ void MediaControlSeekButtonElement::defaultEventHandler(Event* event) m_capturing = true; frame->eventHandler()->setCapturingMouseEventsNode(this); } - m_mediaElement->pause(); + m_mediaElement->pause(event->fromUserGesture()); m_seekTimer.startRepeating(cSeekRepeatDelay); event->setDefaultHandled(); } else if (event->type() == eventNames().mouseupEvent) { @@ -731,30 +731,9 @@ void MediaControlTimeDisplayElement::setVisible(bool visible) renderer()->setStyle(style.get()); } -String MediaControlTimeDisplayElement::formatTime(float time) -{ - if (!isfinite(time)) - time = 0; - int seconds = (int)fabsf(time); - int hours = seconds / (60 * 60); - int minutes = (seconds / 60) % 60; - seconds %= 60; - if (hours) { - if (hours > 9) - return String::format("%s%02d:%02d:%02d", (time < 0 ? "-" : ""), hours, minutes, seconds); - - return String::format("%s%01d:%02d:%02d", (time < 0 ? "-" : ""), hours, minutes, seconds); - } - - return String::format("%s%02d:%02d", (time < 0 ? "-" : ""), minutes, seconds); -} - void MediaControlTimeDisplayElement::setCurrentValue(float time) { m_currentValue = time; - - ExceptionCode ec; - setInnerText(formatTime(m_currentValue), ec); } diff --git a/WebCore/rendering/MediaControlElements.h b/WebCore/rendering/MediaControlElements.h index 0ba4aba..21831ce 100644 --- a/WebCore/rendering/MediaControlElements.h +++ b/WebCore/rendering/MediaControlElements.h @@ -268,8 +268,6 @@ public: float currentValue() const { return m_currentValue; } private: - String formatTime(float time); - float m_currentValue; bool m_isVisible; }; diff --git a/WebCore/rendering/RenderBoxModelObject.cpp b/WebCore/rendering/RenderBoxModelObject.cpp index f2cd9bd..a68c930 100644 --- a/WebCore/rendering/RenderBoxModelObject.cpp +++ b/WebCore/rendering/RenderBoxModelObject.cpp @@ -118,7 +118,7 @@ bool RenderBoxModelScaleObserver::shouldPaintBackgroundAtLowQuality(GraphicsCont { // If the image is not a bitmap image, then none of this is relevant and we just paint at high // quality. - if (!image->isBitmapImage()) + if (!image || !image->isBitmapImage()) return false; // Make sure to use the unzoomed image size, since if a full page zoom is in effect, the image diff --git a/WebCore/rendering/RenderCounter.cpp b/WebCore/rendering/RenderCounter.cpp index 46bf9f4..3cb9a07 100644 --- a/WebCore/rendering/RenderCounter.cpp +++ b/WebCore/rendering/RenderCounter.cpp @@ -430,7 +430,8 @@ static void updateCounters(RenderObject* renderer) continue; if (parent) parent->removeChild(node, it->first.get()); - newParent->insertAfter(node, newPreviousSibling, it->first.get()); + if (newParent) + newParent->insertAfter(node, newPreviousSibling, it->first.get()); } } diff --git a/WebCore/rendering/RenderFieldset.cpp b/WebCore/rendering/RenderFieldset.cpp index 1f2b371..889b0bc 100644 --- a/WebCore/rendering/RenderFieldset.cpp +++ b/WebCore/rendering/RenderFieldset.cpp @@ -119,6 +119,9 @@ RenderBox* RenderFieldset::findLegend() const void RenderFieldset::paintBoxDecorations(PaintInfo& paintInfo, int tx, int ty) { + if (!shouldPaintWithinRoot(paintInfo)) + return; + int w = width(); int h = height(); RenderBox* legend = findLegend(); diff --git a/WebCore/rendering/RenderImage.h b/WebCore/rendering/RenderImage.h index bc5e2d8..b89a652 100644 --- a/WebCore/rendering/RenderImage.h +++ b/WebCore/rendering/RenderImage.h @@ -64,6 +64,8 @@ protected: bool isWidthSpecified() const; bool isHeightSpecified() const; + virtual void intrinsicSizeChanged() { imageChanged(imagePtr()); } + private: virtual const char* renderName() const { return "RenderImage"; } @@ -89,8 +91,6 @@ private: virtual IntSize imageSize(float multiplier) const { return m_cachedImage ? m_cachedImage->imageSize(multiplier) : IntSize(); } virtual WrappedImagePtr imagePtr() const { return m_cachedImage.get(); } - virtual void intrinsicSizeChanged() { imageChanged(imagePtr()); } - int calcAspectRatioWidth() const; int calcAspectRatioHeight() const; diff --git a/WebCore/rendering/RenderMedia.cpp b/WebCore/rendering/RenderMedia.cpp index 8acebfb..7100435 100644 --- a/WebCore/rendering/RenderMedia.cpp +++ b/WebCore/rendering/RenderMedia.cpp @@ -412,10 +412,15 @@ void RenderMedia::updateTimeDisplay() { if (!m_currentTimeDisplay || !m_currentTimeDisplay->renderer() || m_currentTimeDisplay->renderer()->style()->display() == NONE || style()->visibility() != VISIBLE) return; + float now = mediaElement()->currentTime(); float duration = mediaElement()->duration(); + // Allow the theme to format the time + ExceptionCode ec; + m_currentTimeDisplay->setInnerText(theme()->formatMediaControlsCurrentTime(now, duration), ec); m_currentTimeDisplay->setCurrentValue(now); + m_timeRemainingDisplay->setInnerText(theme()->formatMediaControlsRemainingTime(now, duration), ec); m_timeRemainingDisplay->setCurrentValue(now - duration); } diff --git a/WebCore/rendering/RenderTable.cpp b/WebCore/rendering/RenderTable.cpp index 677851e..61e05ad 100644 --- a/WebCore/rendering/RenderTable.cpp +++ b/WebCore/rendering/RenderTable.cpp @@ -552,6 +552,9 @@ void RenderTable::paintObject(PaintInfo& paintInfo, int tx, int ty) void RenderTable::paintBoxDecorations(PaintInfo& paintInfo, int tx, int ty) { + if (!shouldPaintWithinRoot(paintInfo)) + return; + int w = width(); int h = height(); diff --git a/WebCore/rendering/RenderTableCell.cpp b/WebCore/rendering/RenderTableCell.cpp index 2395527..39a821f 100644 --- a/WebCore/rendering/RenderTableCell.cpp +++ b/WebCore/rendering/RenderTableCell.cpp @@ -814,6 +814,9 @@ void RenderTableCell::paintCollapsedBorder(GraphicsContext* graphicsContext, int void RenderTableCell::paintBackgroundsBehindCell(PaintInfo& paintInfo, int tx, int ty, RenderObject* backgroundObject) { + if (!shouldPaintWithinRoot(paintInfo)) + return; + if (!backgroundObject) return; @@ -853,6 +856,9 @@ void RenderTableCell::paintBackgroundsBehindCell(PaintInfo& paintInfo, int tx, i void RenderTableCell::paintBoxDecorations(PaintInfo& paintInfo, int tx, int ty) { + if (!shouldPaintWithinRoot(paintInfo)) + return; + RenderTable* tableElt = table(); if (!tableElt->collapseBorders() && style()->emptyCells() == HIDE && !firstChild()) return; diff --git a/WebCore/rendering/RenderTextControlMultiLine.cpp b/WebCore/rendering/RenderTextControlMultiLine.cpp index afc3edd..0b4c7a7 100644 --- a/WebCore/rendering/RenderTextControlMultiLine.cpp +++ b/WebCore/rendering/RenderTextControlMultiLine.cpp @@ -50,7 +50,7 @@ void RenderTextControlMultiLine::subtreeHasChanged() RenderTextControl::subtreeHasChanged(); HTMLTextAreaElement* textArea = static_cast<HTMLTextAreaElement*>(node()); textArea->setFormControlValueMatchesRenderer(false); - textArea->updateValidity(); + textArea->setNeedsValidityCheck(); if (!node()->focused()) return; diff --git a/WebCore/rendering/RenderTheme.cpp b/WebCore/rendering/RenderTheme.cpp index af92465..f1e564b 100644 --- a/WebCore/rendering/RenderTheme.cpp +++ b/WebCore/rendering/RenderTheme.cpp @@ -440,6 +440,35 @@ bool RenderTheme::shouldRenderMediaControlPart(ControlPart part, Element* e) return true; } } + +String RenderTheme::formatMediaControlsTime(float time) const +{ + if (!isfinite(time)) + time = 0; + int seconds = (int)fabsf(time); + int hours = seconds / (60 * 60); + int minutes = (seconds / 60) % 60; + seconds %= 60; + if (hours) { + if (hours > 9) + return String::format("%s%02d:%02d:%02d", (time < 0 ? "-" : ""), hours, minutes, seconds); + + return String::format("%s%01d:%02d:%02d", (time < 0 ? "-" : ""), hours, minutes, seconds); + } + + return String::format("%s%02d:%02d", (time < 0 ? "-" : ""), minutes, seconds); +} + +String RenderTheme::formatMediaControlsCurrentTime(float currentTime, float /*duration*/) const +{ + return formatMediaControlsTime(currentTime); +} + +String RenderTheme::formatMediaControlsRemainingTime(float currentTime, float duration) const +{ + return formatMediaControlsTime(currentTime - duration); +} + #endif Color RenderTheme::activeSelectionBackgroundColor() const diff --git a/WebCore/rendering/RenderTheme.h b/WebCore/rendering/RenderTheme.h index a7c6e13..32ae5e5 100644 --- a/WebCore/rendering/RenderTheme.h +++ b/WebCore/rendering/RenderTheme.h @@ -175,6 +175,9 @@ public: virtual bool shouldRenderMediaControlPart(ControlPart, Element*); virtual double mediaControlsFadeInDuration() { return 0.1; } virtual double mediaControlsFadeOutDuration() { return 0.3; } + virtual String formatMediaControlsTime(float time) const; + virtual String formatMediaControlsCurrentTime(float currentTime, float duration) const; + virtual String formatMediaControlsRemainingTime(float currentTime, float duration) const; #endif protected: diff --git a/WebCore/rendering/RenderThemeChromiumLinux.cpp b/WebCore/rendering/RenderThemeChromiumLinux.cpp index f972a12..13c9cd6 100644 --- a/WebCore/rendering/RenderThemeChromiumLinux.cpp +++ b/WebCore/rendering/RenderThemeChromiumLinux.cpp @@ -25,8 +25,8 @@ #include "config.h" #include "RenderThemeChromiumLinux.h" -#include "Color.h" #include "CSSValueKeywords.h" +#include "Color.h" #include "RenderObject.h" #include "UserAgentStyleSheets.h" @@ -44,6 +44,8 @@ unsigned RenderThemeChromiumLinux::m_inactiveSelectionBackgroundColor = unsigned RenderThemeChromiumLinux::m_inactiveSelectionForegroundColor = 0xff323232; +double RenderThemeChromiumLinux::m_caretBlinkInterval; + PassRefPtr<RenderTheme> RenderThemeChromiumLinux::create() { return adoptRef(new RenderThemeChromiumLinux()); diff --git a/WebCore/rendering/RenderThemeChromiumLinux.h b/WebCore/rendering/RenderThemeChromiumLinux.h index 90b043d..c60dec3 100644 --- a/WebCore/rendering/RenderThemeChromiumLinux.h +++ b/WebCore/rendering/RenderThemeChromiumLinux.h @@ -56,7 +56,7 @@ namespace WebCore { virtual void adjustSliderThumbSize(RenderObject*) const; - void setCaretBlinkInterval(double interval); + static void setCaretBlinkInterval(double interval); virtual double caretBlinkIntervalInternal() const; static void setSelectionColors(unsigned activeBackgroundColor, @@ -78,7 +78,7 @@ namespace WebCore { // A general method asking if any control tinting is supported at all. virtual bool supportsControlTints() const; - double m_caretBlinkInterval; + static double m_caretBlinkInterval; static unsigned m_activeSelectionBackgroundColor; static unsigned m_activeSelectionForegroundColor; diff --git a/WebCore/rendering/RenderThemeChromiumMac.h b/WebCore/rendering/RenderThemeChromiumMac.h index 61b5e8f..8101038 100644 --- a/WebCore/rendering/RenderThemeChromiumMac.h +++ b/WebCore/rendering/RenderThemeChromiumMac.h @@ -191,7 +191,6 @@ private: mutable HashMap<int, RGBA32> m_systemColorCache; RetainPtr<WebCoreRenderThemeNotificationObserver> m_notificationObserver; - bool paintMediaButtonInternal(GraphicsContext*, const IntRect&, Image*); }; } // namespace WebCore diff --git a/WebCore/rendering/RenderThemeChromiumMac.mm b/WebCore/rendering/RenderThemeChromiumMac.mm index 4e57cb5..e274b05 100644 --- a/WebCore/rendering/RenderThemeChromiumMac.mm +++ b/WebCore/rendering/RenderThemeChromiumMac.mm @@ -41,7 +41,7 @@ #import "RenderSlider.h" #import "RenderView.h" #import "SharedBuffer.h" -#import "UserAgentStyleSheets.h" +#import "TimeRanges.h" #import "WebCoreSystemInterface.h" #import "UserAgentStyleSheets.h" #import <Carbon/Carbon.h> @@ -78,7 +78,7 @@ using std::min; // The methods in this file are specific to the Mac OS X platform. -// FIXME: The platform-independent code in this class should be factored out and merged with RenderThemeSafari. +// FIXME: The platform-independent code in this class should be factored out and merged with RenderThemeSafari. @interface WebCoreRenderThemeNotificationObserver : NSObject { @@ -96,7 +96,7 @@ using std::min; { [super init]; _theme = theme; - + return self; } @@ -322,7 +322,7 @@ static RGBA32 convertNSColorToColor(NSColor *color) static_cast<int>(scaleFactor * [colorInColorSpace blueComponent])); } - // This conversion above can fail if the NSColor in question is an NSPatternColor + // This conversion above can fail if the NSColor in question is an NSPatternColor // (as many system colors are). These colors are actually a repeating pattern // not just a solid color. To work around this we simply draw a 1x1 image of // the color and use that pixel's color. It might be better to use an average of @@ -390,7 +390,7 @@ Color RenderThemeChromiumMac::systemColor(int cssValueId) const { if (m_systemColorCache.contains(cssValueId)) return m_systemColorCache.get(cssValueId); - + Color color; switch (cssValueId) { case CSSValueActiveborder: @@ -504,7 +504,7 @@ bool RenderThemeChromiumMac::isControlStyled(const RenderStyle* style, const Bor { if (style->appearance() == TextFieldPart || style->appearance() == TextAreaPart || style->appearance() == ListboxPart) return style->border() != border; - + // FIXME: This is horrible, but there is not much else that can be done. Menu lists cannot draw properly when // scaled. They can't really draw properly when transformed either. We can't detect the transform case at style // adjustment time so that will just have to stay broken. We can however detect that we're zooming. If zooming @@ -518,13 +518,14 @@ bool RenderThemeChromiumMac::isControlStyled(const RenderStyle* style, const Bor void RenderThemeChromiumMac::adjustRepaintRect(const RenderObject* o, IntRect& r) { ControlPart part = o->style()->appearance(); - + #if USE(NEW_THEME) switch (part) { case CheckboxPart: case RadioPart: case PushButtonPart: case SquareButtonPart: + case ListButtonPart: case DefaultButtonPart: case ButtonPart: return RenderTheme::adjustRepaintRect(o, r); @@ -565,7 +566,7 @@ IntRect RenderThemeChromiumMac::inflateRect(const IntRect& r, const IntSize& siz FloatRect RenderThemeChromiumMac::convertToPaintingRect(const RenderObject* inputRenderer, const RenderObject* partRenderer, const FloatRect& inputRect, const IntRect& r) const { FloatRect partRect(inputRect); - + // Compute an offset between the part renderer and the input renderer FloatSize offsetFromInputRenderer; const RenderObject* renderer = partRenderer; @@ -760,7 +761,7 @@ bool RenderThemeChromiumMac::paintCapsLockIndicator(RenderObject*, const RenderO LocalCurrentGraphicsContext localContext(paintInfo.context); wkDrawCapsLockIndicator(paintInfo.context->platformContext(), r); - + return false; } @@ -820,7 +821,7 @@ bool RenderThemeChromiumMac::paintMenuList(RenderObject* o, const RenderObject:: inflatedRect = inflateRect(inflatedRect, size, popupButtonMargins(), zoomLevel); paintInfo.context->save(); - + #ifndef BUILDING_ON_TIGER // On Leopard, the cell will draw outside of the given rect, so we have to clip to the rect paintInfo.context->clip(inflatedRect); @@ -980,10 +981,10 @@ bool RenderThemeChromiumMac::paintMenuListButton(RenderObject* o, const RenderOb if (bounds.width() < arrowWidth + arrowPaddingLeft * o->style()->effectiveZoom()) return false; - + paintInfo.context->save(); - paintInfo.context->setFillColor(o->style()->color(), DeviceColorSpace); + paintInfo.context->setFillColor(o->style()->color(), o->style()->colorSpace()); paintInfo.context->setStrokeStyle(NoStroke); FloatPoint arrow1[3]; @@ -1036,7 +1037,7 @@ void RenderThemeChromiumMac::adjustMenuListStyle(CSSStyleSelector* selector, Ren style->resetBorder(); style->resetPadding(); - + // Height is locked to auto. style->setHeight(Length(Auto)); @@ -1106,7 +1107,7 @@ void RenderThemeChromiumMac::adjustMenuListButtonStyle(CSSStyleSelector*, Render const int minHeight = 15; style->setMinHeight(Length(minHeight, Fixed)); - + style->setLineHeight(RenderStyle::initialLineHeight()); } @@ -1136,6 +1137,9 @@ int RenderThemeChromiumMac::minimumMenuListSize(RenderStyle* style) const return sizeForSystemFont(style, menuListSizes()).width(); } +const int trackWidth = 5; +const int trackRadius = 2; + void RenderThemeChromiumMac::adjustSliderTrackStyle(CSSStyleSelector*, RenderStyle* style, Element*) const { style->setBoxShadow(0); @@ -1143,9 +1147,6 @@ void RenderThemeChromiumMac::adjustSliderTrackStyle(CSSStyleSelector*, RenderSty bool RenderThemeChromiumMac::paintSliderTrack(RenderObject* o, const RenderObject::PaintInfo& paintInfo, const IntRect& r) { - static const int trackWidth = 5; - static const int trackRadius = 2; - IntRect bounds = r; float zoomLevel = o->style()->effectiveZoom(); float zoomedTrackWidth = trackWidth * zoomLevel; @@ -1179,7 +1180,7 @@ bool RenderThemeChromiumMac::paintSliderTrack(RenderObject* o, const RenderObjec radius, radius); CGContextDrawShading(context, mainShading.get()); paintInfo.context->restore(); - + return false; } @@ -1201,7 +1202,7 @@ bool RenderThemeChromiumMac::paintSliderThumb(RenderObject* o, const RenderObjec LocalCurrentGraphicsContext localContext(paintInfo.context); // Update the various states we respond to. - updateActiveState(sliderThumbCell, o); + updateActiveState(sliderThumbCell, o->parent()); updateEnabledState(sliderThumbCell, o->parent()); updateFocusedState(sliderThumbCell, o->parent()); @@ -1233,7 +1234,7 @@ bool RenderThemeChromiumMac::paintSliderThumb(RenderObject* o, const RenderObjec paintInfo.context->save(); float zoomLevel = o->style()->effectiveZoom(); - + FloatRect unzoomedRect = bounds; if (zoomLevel != 1.0f) { unzoomedRect.setWidth(unzoomedRect.width() / zoomLevel); @@ -1251,22 +1252,6 @@ bool RenderThemeChromiumMac::paintSliderThumb(RenderObject* o, const RenderObjec return false; } -void RenderThemeChromiumMac::adjustSliderThumbSize(RenderObject* o) const -{ - static const int sliderThumbWidth = 15; - static const int sliderThumbHeight = 15; - - float zoomLevel = o->style()->effectiveZoom(); - if (o->style()->appearance() == SliderThumbHorizontalPart || o->style()->appearance() == SliderThumbVerticalPart) { - o->style()->setWidth(Length(static_cast<int>(sliderThumbWidth * zoomLevel), Fixed)); - o->style()->setHeight(Length(static_cast<int>(sliderThumbHeight * zoomLevel), Fixed)); - } - -#if ENABLE(VIDEO) - RenderMediaControlsChromium::adjustMediaSliderThumbSize(o); -#endif -} - bool RenderThemeChromiumMac::paintSearchField(RenderObject* o, const RenderObject::PaintInfo& paintInfo, const IntRect& r) { NSSearchFieldCell* search = this->search(); @@ -1279,7 +1264,7 @@ bool RenderThemeChromiumMac::paintSearchField(RenderObject* o, const RenderObjec float zoomLevel = o->style()->effectiveZoom(); IntRect unzoomedRect = r; - + if (zoomLevel != 1.0f) { unzoomedRect.setWidth(unzoomedRect.width() / zoomLevel); unzoomedRect.setHeight(unzoomedRect.height() / zoomLevel); @@ -1328,7 +1313,7 @@ void RenderThemeChromiumMac::setSearchFieldSize(RenderStyle* style) const // If the width and height are both specified, then we have nothing to do. if (!style->width().isIntrinsicOrAuto() && !style->height().isAuto()) return; - + // Use the font size to determine the intrinsic width of the control. setSizeFromFont(style, searchFieldSizes()); } @@ -1345,19 +1330,19 @@ void RenderThemeChromiumMac::adjustSearchFieldStyle(CSSStyleSelector* selector, style->setBorderBottomWidth(borderWidth); style->setBorderBottomStyle(INSET); style->setBorderTopWidth(borderWidth); - style->setBorderTopStyle(INSET); - + style->setBorderTopStyle(INSET); + // Override height. style->setHeight(Length(Auto)); setSearchFieldSize(style); - + // Override padding size to match AppKit text positioning. const int padding = 1 * style->effectiveZoom(); style->setPaddingLeft(Length(padding, Fixed)); style->setPaddingRight(Length(padding, Fixed)); style->setPaddingTop(Length(padding, Fixed)); style->setPaddingBottom(Length(padding, Fixed)); - + NSControlSize controlSize = controlSizeForFont(style); setFontFromControlSize(selector, style, controlSize); @@ -1495,7 +1480,7 @@ bool RenderThemeChromiumMac::paintSearchFieldResultsButton(RenderObject* o, cons FloatRect localBounds = [search searchButtonRectForBounds:NSRect(input->renderBox()->borderBoxRect())]; localBounds = convertToPaintingRect(input->renderer(), o, localBounds, r); - + IntRect unzoomedRect(localBounds); if (zoomLevel != 1.0f) { unzoomedRect.setWidth(unzoomedRect.width() / zoomLevel); @@ -1507,12 +1492,28 @@ bool RenderThemeChromiumMac::paintSearchFieldResultsButton(RenderObject* o, cons [[search searchButtonCell] drawWithFrame:unzoomedRect inView:FlippedView()]; [[search searchButtonCell] setControlView:nil]; - + paintInfo.context->restore(); return false; } +const int sliderThumbWidth = 15; +const int sliderThumbHeight = 15; + +void RenderThemeChromiumMac::adjustSliderThumbSize(RenderObject* o) const +{ + float zoomLevel = o->style()->effectiveZoom(); + if (o->style()->appearance() == SliderThumbHorizontalPart || o->style()->appearance() == SliderThumbVerticalPart) { + o->style()->setWidth(Length(static_cast<int>(sliderThumbWidth * zoomLevel), Fixed)); + o->style()->setHeight(Length(static_cast<int>(sliderThumbHeight * zoomLevel), Fixed)); + } + +#if ENABLE(VIDEO) + RenderMediaControlsChromium::adjustMediaSliderThumbSize(o); +#endif +} + #if ENABLE(VIDEO) bool RenderThemeChromiumMac::shouldRenderMediaControlPart(ControlPart part, Element* e) { @@ -1553,7 +1554,7 @@ bool RenderThemeChromiumMac::paintMediaControlsBackground(RenderObject* object, { return RenderMediaControlsChromium::paintMediaControlsPart(MediaTimelineContainer, object, paintInfo, rect); } - + String RenderThemeChromiumMac::extraMediaControlsStyleSheet() { return String(mediaControlsChromiumUserAgentStyleSheet, sizeof(mediaControlsChromiumUserAgentStyleSheet)); @@ -1568,7 +1569,7 @@ NSPopUpButtonCell* RenderThemeChromiumMac::popupButton() const [m_popupButton.get() setUsesItemFromMenu:NO]; [m_popupButton.get() setFocusRingType:NSFocusRingTypeExterior]; } - + return m_popupButton.get(); } @@ -1602,7 +1603,7 @@ NSSliderCell* RenderThemeChromiumMac::sliderThumbHorizontal() const [m_sliderThumbHorizontal.get() setControlSize:NSSmallControlSize]; [m_sliderThumbHorizontal.get() setFocusRingType:NSFocusRingTypeExterior]; } - + return m_sliderThumbHorizontal.get(); } @@ -1615,7 +1616,7 @@ NSSliderCell* RenderThemeChromiumMac::sliderThumbVertical() const [m_sliderThumbVertical.get() setControlSize:NSSmallControlSize]; [m_sliderThumbVertical.get() setFocusRingType:NSFocusRingTypeExterior]; } - + return m_sliderThumbVertical.get(); } diff --git a/WebCore/rendering/RenderVideo.cpp b/WebCore/rendering/RenderVideo.cpp index d2a9620..813f2ef 100644 --- a/WebCore/rendering/RenderVideo.cpp +++ b/WebCore/rendering/RenderVideo.cpp @@ -85,7 +85,7 @@ RenderVideo::~RenderVideo() void RenderVideo::intrinsicSizeChanged() { if (videoElement()->shouldDisplayPosterImage()) - RenderVideo::intrinsicSizeChanged(); + RenderMedia::intrinsicSizeChanged(); videoSizeChanged(); } @@ -104,7 +104,7 @@ void RenderVideo::videoSizeChanged() void RenderVideo::imageChanged(WrappedImagePtr newImage, const IntRect* rect) { - RenderImage::imageChanged(newImage, rect); + RenderMedia::imageChanged(newImage, rect); // Cache the image intrinsic size so we can continue to use it to draw the image correctly // even after we know the video intrisic size but aren't able to draw video frames yet |