Bug 1138527 part 1 - Make ruby annotations have the same font inflation as its containing ruby frame. r=roc

--HG--
extra : source : d4f7098b00f88131e2a45a80ce09e6995eb44ed3
This commit is contained in:
Xidorn Quan 2015-03-03 16:06:36 +11:00
Родитель a8ea0bbfe8
Коммит e7dadd8f81
1 изменённых файлов: 12 добавлений и 1 удалений

Просмотреть файл

@ -7227,14 +7227,25 @@ nsLayoutUtils::FontSizeInflationInner(const nsIFrame *aFrame,
f = f->GetParent()) {
nsIContent* content = f->GetContent();
nsIAtom* fType = f->GetType();
nsIFrame* parent = f->GetParent();
// 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) &&
if (!(parent && parent->GetContent() == content) &&
// 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) {
// ruby annotations should have the same inflation as its
// grandparent, which is the ruby frame contains the annotation.
if (fType == nsGkAtoms::rubyTextFrame) {
MOZ_ASSERT(parent &&
parent->GetType() == nsGkAtoms::rubyTextContainerFrame);
nsIFrame* grandparent = parent->GetParent();
MOZ_ASSERT(grandparent &&
grandparent->GetType() == nsGkAtoms::rubyFrame);
return FontSizeInflationFor(grandparent);
}
nsStyleCoord stylePosWidth = f->StylePosition()->mWidth;
nsStyleCoord stylePosHeight = f->StylePosition()->mHeight;
if (stylePosWidth.GetUnit() != eStyleUnit_Auto ||