mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-06 15:58:39 +09:00
Bug 1443092 - Avoid calling SVGAnimatedEnumeration::AnimVal() from nsSVGUtils::GetBBox(). r=jwatt, a=RyanVM
AnimVal() is a DOM getter, and it flushes animations, which we don't want in GetBBox() which is called from display list building cide and FrameLayerBuilder. MozReview-Commit-ID: DWgm7wAV7C0
This commit is contained in:
parent
5ec40a0c76
commit
7f57b96c83
3 changed files with 12 additions and 2 deletions
|
|
@ -50,6 +50,13 @@ SVGClipPathElement::GetEnumInfo()
|
|||
ArrayLength(sEnumInfo));
|
||||
}
|
||||
|
||||
bool
|
||||
SVGClipPathElement::IsUnitsObjectBoundingBox() const
|
||||
{
|
||||
return mEnumAttributes[CLIPPATHUNITS].GetAnimValue() == SVG_UNIT_TYPE_OBJECTBOUNDINGBOX;
|
||||
}
|
||||
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// nsIDOMNode methods
|
||||
|
||||
|
|
|
|||
|
|
@ -36,6 +36,10 @@ public:
|
|||
// WebIDL
|
||||
already_AddRefed<SVGAnimatedEnumeration> ClipPathUnits();
|
||||
|
||||
// This is an internal method that does not flush style, and thus
|
||||
// the answer may be out of date if there's a pending style flush.
|
||||
bool IsUnitsObjectBoundingBox() const;
|
||||
|
||||
protected:
|
||||
|
||||
enum { CLIPPATHUNITS };
|
||||
|
|
|
|||
|
|
@ -1127,8 +1127,7 @@ nsSVGUtils::GetBBox(nsIFrame *aFrame, uint32_t aFlags)
|
|||
if (clipPathFrame && isOK) {
|
||||
SVGClipPathElement *clipContent =
|
||||
static_cast<SVGClipPathElement*>(clipPathFrame->GetContent());
|
||||
RefPtr<SVGAnimatedEnumeration> units = clipContent->ClipPathUnits();
|
||||
if (units->AnimVal() == SVG_UNIT_TYPE_OBJECTBOUNDINGBOX) {
|
||||
if (clipContent->IsUnitsObjectBoundingBox()) {
|
||||
matrix.Translate(gfxPoint(x, y));
|
||||
matrix.Scale(width, height);
|
||||
} else if (aFrame->GetType() == nsGkAtoms::svgForeignObjectFrame) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue