mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-22 01:35:35 +00:00
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:
parent
581512e97a
commit
59c534ddde
@ -542,12 +542,24 @@ GlyphObserver::NotifyGlyphsChanged()
|
||||
break;
|
||||
}
|
||||
f->InvalidateFrame();
|
||||
// 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
|
||||
// of text frames affected and we'd like to coalesce the work. So that's
|
||||
// not easy to do well.
|
||||
shell->FrameNeedsReflow(f, nsIPresShell::eResize, NS_FRAME_IS_DIRTY);
|
||||
|
||||
// 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
|
||||
// of text frames affected and we'd like to coalesce the work. So that's
|
||||
// not easy to do well.
|
||||
shell->FrameNeedsReflow(f, nsIPresShell::eResize, NS_FRAME_IS_DIRTY);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -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();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user