Title: [113383] branches/subpixellayout/Source/WebCore/rendering/RenderInputSpeech.cpp
Revision
113383
Author
[email protected]
Date
2012-04-05 14:51:26 -0700 (Thu, 05 Apr 2012)

Log Message

Cleanyp RenderInputSpeech on branch.

Modified Paths


Diff

Modified: branches/subpixellayout/Source/WebCore/rendering/RenderInputSpeech.cpp (113382 => 113383)


--- branches/subpixellayout/Source/WebCore/rendering/RenderInputSpeech.cpp	2012-04-05 21:32:37 UTC (rev 113382)
+++ branches/subpixellayout/Source/WebCore/rendering/RenderInputSpeech.cpp	2012-04-05 21:51:26 UTC (rev 113383)
@@ -66,19 +66,19 @@
     if (!input->renderer()->isBox())
         return false;
     RenderBox* inputRenderBox = toRenderBox(input->renderer());
-    IntRect inputContentBox = pixelSnappedIntRect(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.pixelSnappedWidth(), std::min(inputContentBox.pixelSnappedHeight(), 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(roundToInt(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 = -roundedIntSize(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 @@
         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;
 }
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to