Bug 706889 - Apply font-inflation to checkboxes and radio buttons. r=dbaron
authorMats Palmgren <matspal@gmail.com>
Mon, 30 Jan 2012 18:48:46 +0100
changeset 85730 4d526d7ec68077adf0d84ea527683fe8e308e7d7
parent 85729 9c30c5187e3e402d0c2c8016dca36fe24d35e14f
child 85731 a308b2b991cb0147468bc2736b41c9d4db8244ed
push id21956
push userbmo@edmorley.co.uk
push dateTue, 31 Jan 2012 03:09:07 +0000
treeherdermozilla-central@ba2a5d61cab5 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdbaron
bugs706889
milestone12.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 706889 - Apply font-inflation to checkboxes and radio buttons. r=dbaron
layout/forms/nsFormControlFrame.cpp
--- a/layout/forms/nsFormControlFrame.cpp
+++ b/layout/forms/nsFormControlFrame.cpp
@@ -32,16 +32,17 @@
  * and other provisions required by the GPL or the LGPL. If you do not delete
  * the provisions above, a recipient may use your version of this file under
  * the terms of any one of the MPL, the GPL or the LGPL.
  *
  * ***** END LICENSE BLOCK ***** */
 
 #include "nsFormControlFrame.h"
 #include "nsGkAtoms.h"
+#include "nsLayoutUtils.h"
 #include "nsIDOMHTMLInputElement.h"
 #include "nsEventStateManager.h"
 #include "mozilla/LookAndFeel.h"
 
 using namespace mozilla;
 
 //#define FCF_NOISY
 
@@ -107,18 +108,31 @@ nsFormControlFrame::Reflow(nsPresContext
 {
   DO_GLOBAL_REFLOW_COUNT("nsFormControlFrame");
   DISPLAY_REFLOW(aPresContext, this, aReflowState, aDesiredSize, aStatus);
 
   if (mState & NS_FRAME_FIRST_REFLOW) {
     RegUnRegAccessKey(static_cast<nsIFrame*>(this), true);
   }
 
-  return nsLeafFrame::Reflow(aPresContext, aDesiredSize, aReflowState,
-                             aStatus);
+  nsresult rv = nsLeafFrame::Reflow(aPresContext, aDesiredSize, aReflowState,
+                                    aStatus);
+  if (NS_FAILED(rv)) {
+    return rv;
+  }
+
+  if (nsLayoutUtils::FontSizeInflationEnabled(aPresContext)) {
+    float inflation =
+      nsLayoutUtils::FontSizeInflationFor(this, nsLayoutUtils::eInReflow);
+    aDesiredSize.width *= inflation;
+    aDesiredSize.height *= inflation;
+    aDesiredSize.UnionOverflowAreasWithDesiredBounds();
+    FinishAndStoreOverflow(&aDesiredSize);
+  }
+  return NS_OK;
 }
 
 nsresult
 nsFormControlFrame::RegUnRegAccessKey(nsIFrame * aFrame, bool aDoReg)
 {
   NS_ENSURE_ARG_POINTER(aFrame);
   
   nsPresContext* presContext = aFrame->PresContext();