Bug 1450250: Preserve the behavior of GetOuterSVGElement so that it works for <animate>. r=heycam

It's used by SVGAnimationElement, and otherwise it can't find the root element
if it's under a <use> element.

It also feels like the right thing to do, and didn't break any XBL+svg tests
(though we may as well get rid of those at this point).

Differential Revision: https://phabricator.services.mozilla.com/D2195

MozReview-Commit-ID: Jx1JrTld8EL
This commit is contained in:
Emilio Cobos Álvarez 2018-07-17 19:32:47 +02:00
Родитель 8eaddfbb80
Коммит a01c54ae7a
1 изменённых файлов: 3 добавлений и 3 удалений

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

@ -41,13 +41,13 @@ using namespace mozilla::gfx;
SVGSVGElement*
SVGContentUtils::GetOuterSVGElement(nsSVGElement *aSVGElement)
{
nsIContent *element = nullptr;
nsIContent *ancestor = aSVGElement->GetFlattenedTreeParent();
Element* element = nullptr;
Element* ancestor = aSVGElement->GetParentElementCrossingShadowRoot();
while (ancestor && ancestor->IsSVGElement() &&
!ancestor->IsSVGElement(nsGkAtoms::foreignObject)) {
element = ancestor;
ancestor = element->GetFlattenedTreeParent();
ancestor = element->GetParentElementCrossingShadowRoot();
}
if (element && element->IsSVGElement(nsGkAtoms::svg)) {