mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-27 04:38:02 +00:00
Bug 265894 - Part 7. Do not convert symbol element into svg element. r=heycam
Since we already have nsSVGSymbolFrame, there is no need to leverage svg element for rendering symbol element in use-element shadow tree, remove conversion code. MozReview-Commit-ID: GmGLZ7Az6Gb --HG-- extra : rebase_source : 897a1fb7b34bb3aa3babe99b7199e7f002d59e6b
This commit is contained in:
parent
c0d6329f0c
commit
5719863244
@ -275,51 +275,6 @@ SVGUseElement::CreateAnonymousContent()
|
||||
if (!newcontent)
|
||||
return nullptr;
|
||||
|
||||
if (newcontent->IsSVGElement(nsGkAtoms::symbol)) {
|
||||
nsIDocument *document = GetComposedDoc();
|
||||
if (!document)
|
||||
return nullptr;
|
||||
|
||||
nsNodeInfoManager *nodeInfoManager = document->NodeInfoManager();
|
||||
if (!nodeInfoManager)
|
||||
return nullptr;
|
||||
|
||||
RefPtr<mozilla::dom::NodeInfo> nodeInfo;
|
||||
nodeInfo = nodeInfoManager->GetNodeInfo(nsGkAtoms::svg, nullptr,
|
||||
kNameSpaceID_SVG,
|
||||
nsIDOMNode::ELEMENT_NODE);
|
||||
|
||||
nsCOMPtr<nsIContent> svgNode;
|
||||
NS_NewSVGSVGElement(getter_AddRefs(svgNode), nodeInfo.forget(),
|
||||
NOT_FROM_PARSER);
|
||||
|
||||
if (!svgNode)
|
||||
return nullptr;
|
||||
|
||||
// copy attributes
|
||||
BorrowedAttrInfo info;
|
||||
uint32_t i;
|
||||
for (i = 0; (info = newcontent->GetAttrInfoAt(i)); i++) {
|
||||
nsAutoString value;
|
||||
int32_t nsID = info.mName->NamespaceID();
|
||||
nsIAtom* lname = info.mName->LocalName();
|
||||
|
||||
info.mValue->ToString(value);
|
||||
|
||||
svgNode->SetAttr(nsID, lname, info.mName->GetPrefix(), value, false);
|
||||
}
|
||||
|
||||
// move the children over
|
||||
uint32_t num = newcontent->GetChildCount();
|
||||
for (i = 0; i < num; i++) {
|
||||
nsCOMPtr<nsIContent> child = newcontent->GetFirstChild();
|
||||
newcontent->RemoveChildAt(0, false);
|
||||
svgNode->InsertChildAt(child, i, true);
|
||||
}
|
||||
|
||||
newcontent = svgNode;
|
||||
}
|
||||
|
||||
if (newcontent->IsAnyOfSVGElements(nsGkAtoms::svg, nsGkAtoms::symbol)) {
|
||||
nsSVGElement *newElement = static_cast<nsSVGElement*>(newcontent.get());
|
||||
|
||||
|
@ -375,7 +375,7 @@ nsSVGDisplayContainerFrame::ReflowSVG()
|
||||
// come from transforms, which are accounted for by nsDisplayTransform.
|
||||
// Note that we rely on |overflow:visible| to allow display list items to be
|
||||
// created for our children.
|
||||
MOZ_ASSERT(mContent->IsSVGElement(nsGkAtoms::svg) ||
|
||||
MOZ_ASSERT(mContent->IsAnyOfSVGElements(nsGkAtoms::svg, nsGkAtoms::symbol) ||
|
||||
(mContent->IsSVGElement(nsGkAtoms::use) &&
|
||||
mRect.Size() == nsSize(0,0)) ||
|
||||
mRect.IsEqualEdges(nsRect()),
|
||||
|
Loading…
x
Reference in New Issue
Block a user