Bug 1331322 - Allow tagging of pseudo-implementing native anonymous content with the pseudo type at creation time, and eliminate explicit style contexts in nsIAnonymousContentCreator::ContentInfo. r=bholley

MozReview-Commit-ID: LO0t92orjWZ
This commit is contained in:
cam@mcc.id.au
2017-01-13 03:21:11 +00:00
parent 5c4aa7f577
commit 0115c32212
19 changed files with 213 additions and 110 deletions

View File

@@ -72,12 +72,9 @@ nsProgressFrame::CreateAnonymousContent(nsTArray<ContentInfo>& aElements)
mBarDiv = doc->CreateHTMLElement(nsGkAtoms::div);
// Associate ::-moz-progress-bar pseudo-element to the anonymous child.
CSSPseudoElementType pseudoType = CSSPseudoElementType::mozProgressBar;
RefPtr<nsStyleContext> newStyleContext = PresContext()->StyleSet()->
ResolvePseudoElementStyle(mContent->AsElement(), pseudoType,
StyleContext(), mBarDiv->AsElement());
mBarDiv->SetPseudoElementType(CSSPseudoElementType::mozProgressBar);
if (!aElements.AppendElement(ContentInfo(mBarDiv, newStyleContext))) {
if (!aElements.AppendElement(mBarDiv)) {
return NS_ERROR_OUT_OF_MEMORY;
}