diff options
| author | Simon Hausmann <simon.hausmann@nokia.com> | 2012-05-07 11:21:11 +0200 |
|---|---|---|
| committer | Simon Hausmann <simon.hausmann@nokia.com> | 2012-05-07 11:21:11 +0200 |
| commit | 2cf6c8816a73e0132bd8fa3b509d62d7c51b6e47 (patch) | |
| tree | 988e8c5b116dd0466244ae2fe5af8ee9be926d76 /Source/WebCore/rendering/RenderInputSpeech.cpp | |
| parent | dd91e772430dc294e3bf478c119ef8d43c0a3358 (diff) | |
| download | qtwebkit-2cf6c8816a73e0132bd8fa3b509d62d7c51b6e47.tar.gz | |
Imported WebKit commit 7e538425aa020340619e927792f3d895061fb54b (http://svn.webkit.org/repository/webkit/trunk@116286)
Diffstat (limited to 'Source/WebCore/rendering/RenderInputSpeech.cpp')
| -rw-r--r-- | Source/WebCore/rendering/RenderInputSpeech.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/Source/WebCore/rendering/RenderInputSpeech.cpp b/Source/WebCore/rendering/RenderInputSpeech.cpp index 0f14925bb..370ae0aec 100644 --- a/Source/WebCore/rendering/RenderInputSpeech.cpp +++ b/Source/WebCore/rendering/RenderInputSpeech.cpp @@ -46,7 +46,7 @@ static const float defaultSpeechButtonSize = 16; static const float minSpeechButtonSize = 8; static const float maxSpeechButtonSize = 40; -void RenderInputSpeech::adjustInputFieldSpeechButtonStyle(CSSStyleSelector*, RenderStyle* style, Element*) +void RenderInputSpeech::adjustInputFieldSpeechButtonStyle(StyleResolver*, RenderStyle* style, Element*) { // Scale the button size based on the font size. float fontScale = style->fontSize() / defaultControlFontPixelSize; @@ -66,19 +66,19 @@ bool RenderInputSpeech::paintInputFieldSpeechButton(RenderObject* object, const if (!input->renderer()->isBox()) return false; RenderBox* inputRenderBox = toRenderBox(input->renderer()); - IntRect inputContentBox = inputRenderBox->contentBoxRect(); + LayoutRect inputContentBox = inputRenderBox->contentBoxRect(); // Make sure the scaled button stays square and will fit in its parent's box. - int buttonSize = std::min(inputContentBox.width(), std::min(inputContentBox.height(), rect.height())); + LayoutUnit buttonSize = std::min(inputContentBox.width(), std::min<LayoutUnit>(inputContentBox.height(), rect.height())); // Calculate button's coordinates relative to the input element. // Center the button vertically. Round up though, so if it has to be one pixel off-center, it will // be one pixel closer to the bottom of the field. This tends to look better with the text. - IntRect buttonRect(object->offsetFromAncestorContainer(inputRenderBox).width(), - inputContentBox.y() + (inputContentBox.height() - buttonSize + 1) / 2, - buttonSize, buttonSize); + LayoutRect buttonRect(object->offsetFromAncestorContainer(inputRenderBox).width(), + inputContentBox.y() + (inputContentBox.height() - buttonSize + 1) / 2, + buttonSize, buttonSize); // Compute an offset between the part renderer and the input renderer. - IntSize offsetFromInputRenderer = -(object->offsetFromAncestorContainer(inputRenderBox)); + LayoutSize offsetFromInputRenderer = -(object->offsetFromAncestorContainer(inputRenderBox)); // Move the rect into partRenderer's coords. buttonRect.move(offsetFromInputRenderer); // Account for the local drawing offset. @@ -94,7 +94,7 @@ bool RenderInputSpeech::paintInputFieldSpeechButton(RenderObject* object, const image = imageStateRecording.get(); else if (speechButton->state() == InputFieldSpeechButtonElement::Recognizing) image = imageStateWaiting.get(); - paintInfo.context->drawImage(image, object->style()->colorSpace(), buttonRect); + paintInfo.context->drawImage(image, object->style()->colorSpace(), pixelSnappedIntRect(buttonRect)); return false; } |
