X-Git-Url: http://git.webkit.org/?p=WebKit-https.git;a=blobdiff_plain;f=Source%2FWebCore%2Frendering%2FRenderFileUploadControl.cpp;h=4b3cb8b16fe450fe7c6aaff7e5c686fc1dba52b4;hp=47e470ca5eaf347a34c65e6a828a4ce95f5b863d;hb=564addb37d8d2af4075395017f8df415959d179d;hpb=58308fe5f9b9ae56aa32df54d65b504f2c90f1cf diff --git a/Source/WebCore/rendering/RenderFileUploadControl.cpp b/Source/WebCore/rendering/RenderFileUploadControl.cpp index 47e470c..4b3cb8b 100644 --- a/Source/WebCore/rendering/RenderFileUploadControl.cpp +++ b/Source/WebCore/rendering/RenderFileUploadControl.cpp @@ -59,7 +59,7 @@ const int defaultWidthNumChars = 38; const int buttonShadowHeight = 2; RenderFileUploadControl::RenderFileUploadControl(HTMLInputElement& input, PassRef style) - : RenderBlockFlow(input, std::move(style)) + : RenderBlockFlow(input, WTF::move(style)) , m_canReceiveDroppedFiles(input.canReceiveDroppedFiles()) { } @@ -70,12 +70,7 @@ RenderFileUploadControl::~RenderFileUploadControl() HTMLInputElement& RenderFileUploadControl::inputElement() const { - return toHTMLInputElement(nodeForNonAnonymous()); -} - -bool RenderFileUploadControl::canBeReplacedWithInlineRunIn() const -{ - return false; + return downcast(nodeForNonAnonymous()); } void RenderFileUploadControl::updateFromElement() @@ -100,13 +95,13 @@ void RenderFileUploadControl::updateFromElement() static int nodeWidth(Node* node) { - return (node && node->renderBox()) ? node->renderBox()->pixelSnappedWidth() : 0; + return (node && node->renderBox()) ? node->renderBox()->pixelSnappedSize().width() : 0; } #if PLATFORM(IOS) static int nodeHeight(Node* node) { - return (node && node->renderBox()) ? node->renderBox()->pixelSnappedHeight() : 0; + return (node && node->renderBox()) ? node->renderBox()->pixelSnappedSize().height() : 0; } #endif @@ -115,7 +110,7 @@ int RenderFileUploadControl::maxFilenameWidth() const #if PLATFORM(IOS) int iconWidth = nodeHeight(uploadButton()); #endif - return std::max(0, contentBoxRect().pixelSnappedWidth() - nodeWidth(uploadButton()) - afterButtonSpacing + return std::max(0, contentBoxRect().pixelSnappedSize().width() - nodeWidth(uploadButton()) - afterButtonSpacing - (inputElement().icon() ? iconWidth + iconFilenameSpacing : 0)); } @@ -187,7 +182,7 @@ void RenderFileUploadControl::paintObject(PaintInfo& paintInfo, const LayoutPoin // Draw the file icon and decorations. IntRect iconRect(iconX, iconY, iconWidth, iconHeight); RenderTheme::FileUploadDecorations decorationsType = inputElement().files()->length() == 1 ? RenderTheme::SingleFile : RenderTheme::MultipleFiles; - theme()->paintFileUploadIconDecorations(this, buttonRenderer, paintInfo, iconRect, inputElement().icon(), decorationsType); + theme().paintFileUploadIconDecorations(*this, *buttonRenderer, paintInfo, iconRect, inputElement().icon(), decorationsType); } #else // Draw the file icon @@ -244,14 +239,14 @@ void RenderFileUploadControl::computePreferredLogicalWidths() m_minPreferredLogicalWidth = std::min(m_minPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(style().maxWidth().value())); } - int toAdd = borderAndPaddingWidth(); + int toAdd = horizontalBorderAndPaddingExtent(); m_minPreferredLogicalWidth += toAdd; m_maxPreferredLogicalWidth += toAdd; setPreferredLogicalWidthsDirty(false); } -VisiblePosition RenderFileUploadControl::positionForPoint(const LayoutPoint&) +VisiblePosition RenderFileUploadControl::positionForPoint(const LayoutPoint&, const RenderRegion*) { return VisiblePosition(); } @@ -260,7 +255,7 @@ HTMLInputElement* RenderFileUploadControl::uploadButton() const { ASSERT(inputElement().shadowRoot()); Node* buttonNode = inputElement().shadowRoot()->firstChild(); - return buttonNode && buttonNode->isHTMLElement() && isHTMLInputElement(buttonNode) ? toHTMLInputElement(buttonNode) : 0; + return is(buttonNode) ? downcast(buttonNode) : nullptr; } String RenderFileUploadControl::buttonValue()