Bug 1135329 - Reflow requests for nondisplay SVGTextFrame while its glyph is updated; r=heycam

MozReview-Commit-ID: 6QiRwx0FYKT

--HG--
extra : transplant_source : U%96%3D%AD%80-%E8%86X%1C%17%A3%F9%29%88H%DB%7Ds%A0
This commit is contained in:
Daosheng Mu 2016-06-24 16:02:44 +08:00
parent 581512e97a
commit 59c534ddde
2 changed files with 20 additions and 8 deletions

View File

@ -542,6 +542,17 @@ GlyphObserver::NotifyGlyphsChanged()
break;
}
f->InvalidateFrame();
// If this is a non-display text frame within SVG <text>, we need
// to reflow the SVGTextFrame. (This is similar to reflowing the
// SVGTextFrame in response to style changes, in
// SVGTextFrame::DidSetStyleContext.)
if (f->IsSVGText() && f->GetStateBits() & NS_FRAME_IS_NONDISPLAY) {
auto svgTextFrame = static_cast<SVGTextFrame*>(
nsLayoutUtils::GetClosestFrameOfType(f,
nsGkAtoms::svgTextFrame));
svgTextFrame->ScheduleReflowSVGNonDisplayText();
} else {
// Theoretically we could just update overflow areas, perhaps using
// OverflowChangedTracker, but that would do a bunch of work eagerly that
// we should probably do lazily here since there could be a lot
@ -549,6 +560,7 @@ GlyphObserver::NotifyGlyphsChanged()
// not easy to do well.
shell->FrameNeedsReflow(f, nsIPresShell::eResize, NS_FRAME_IS_DIRTY);
}
}
}
int32_t nsTextFrame::GetContentEnd() const {

View File

@ -399,8 +399,8 @@ public:
* it.
*
* The only case where we have to do this is in response to a style change on
* a non-display <text>; the only caller of ScheduleReflowSVGNonDisplayText
* currently is SVGTextFrame::DidSetStyleContext.
* a non-display <text>. It is done in response to glyphs changes on
* non-display <text> (i.e., animated SVG-in-OpenType glyphs).
*/
void ScheduleReflowSVGNonDisplayText();