Commit 184cc4a6 authored by Jonathan Kew's avatar Jonathan Kew Committed by Pier Angelo Vendrame
Browse files

Bug 2029446 - Don't create frames for elements that are not allowed in an...

Bug 2029446 - Don't create frames for elements that are not allowed in an svg-glyphs document.  a=RyanVM DONTBUILD

Original Revision: https://phabricator.services.mozilla.com/D293133

Differential Revision: https://phabricator.services.mozilla.com/D293514
parent 80e291af
Loading
Loading
Loading
Loading
+12 −0
Original line number Diff line number Diff line
@@ -4791,6 +4791,18 @@ nsCSSFrameConstructor::FindSVGData(const Element& aElement,

  nsAtom* tag = aElement.NodeInfo()->NameAtom();

  if (aElement.OwnerDoc()->IsSVGGlyphsDocument()) {
    // SVG elements that are explicitly not supported in svg-glyphs documents.
    // (Partially applies the restrictions mentioned at
    // https://learn.microsoft.com/en-us/typography/opentype/spec/svg#svg-capability-requirements-and-restrictions
    if (tag == nsGkAtoms::text || tag == nsGkAtoms::tspan ||
        tag == nsGkAtoms::textPath || tag == nsGkAtoms::a ||
        tag == nsGkAtoms::foreignObject || tag == nsGkAtoms::svgSwitch ||
        tag == nsGkAtoms::view) {
      return &sSuppressData;
    }
  }

  // XXXbz should this really be based on the tag of the parent frame's content?
  // Should it not be based on the type of the parent frame (e.g. whether it's
  // an SVG frame)?