Restore application of font size inflation to radios and checkboxes. (Bug 757937) r=roc

This commit is contained in:
L. David Baron 2012-06-04 16:26:30 -07:00
parent b06853949d
commit 9ebd0616c4
4 changed files with 15 additions and 1 deletions

View File

@ -1681,6 +1681,7 @@ GK_ATOM(comboboxControlFrame, "ComboboxControlFrame")
GK_ATOM(comboboxDisplayFrame, "ComboboxDisplayFrame")
GK_ATOM(deckFrame, "DeckFrame")
GK_ATOM(fieldSetFrame, "FieldSetFrame")
GK_ATOM(formControlFrame, "FormControlFrame") // radio or checkbox
GK_ATOM(frameSetFrame, "FrameSetFrame")
GK_ATOM(gfxButtonControlFrame, "gfxButtonControlFrame")
GK_ATOM(HTMLButtonControlFrame, "HTMLButtonControlFrame")

View File

@ -4758,10 +4758,15 @@ nsLayoutUtils::FontSizeInflationInner(const nsIFrame *aFrame,
f && !IsContainerForFontSizeInflation(f);
f = f->GetParent()) {
nsIContent* content = f->GetContent();
nsIAtom* fType = f->GetType();
// Also, if there is more than one frame corresponding to a single
// content node, we want the outermost one.
if (!(f->GetParent() && f->GetParent()->GetContent() == content) &&
f->GetType() != nsGkAtoms::inlineFrame) {
// ignore width/height on inlines since they don't apply
fType != nsGkAtoms::inlineFrame &&
// ignore width on radios and checkboxes since we enlarge them and
// they have width/height in ua.css
fType != nsGkAtoms::formControlFrame) {
nsStyleCoord stylePosWidth = f->GetStylePosition()->mWidth;
nsStyleCoord stylePosHeight = f->GetStylePosition()->mHeight;
if (stylePosWidth.GetUnit() != eStyleUnit_Auto ||

View File

@ -25,6 +25,12 @@ nsFormControlFrame::~nsFormControlFrame()
{
}
nsIAtom*
nsFormControlFrame::GetType() const
{
return nsGkAtoms::formControlFrame;
}
void
nsFormControlFrame::DestroyFrom(nsIFrame* aDestructRoot)
{

View File

@ -25,6 +25,8 @@ public:
*/
nsFormControlFrame(nsStyleContext*);
virtual nsIAtom* GetType() const;
virtual bool IsFrameOfType(PRUint32 aFlags) const
{
return nsLeafFrame::IsFrameOfType(aFlags &