mirror of
https://github.com/roytam1/basilisk55.git
synced 2026-05-27 00:30:27 +00:00
ported from UXP: Bug 1331322 - Allow tagging of pseudo-implementing native anonymous content with the pseudo type at creation time (b723a5c8)
This commit is contained in:
@@ -69,6 +69,7 @@ nsColorControlFrame::CreateAnonymousContent(nsTArray<ContentInfo>& aElements)
|
||||
{
|
||||
nsCOMPtr<nsIDocument> doc = mContent->GetComposedDoc();
|
||||
mColorContent = doc->CreateHTMLElement(nsGkAtoms::div);
|
||||
mColorContent->SetPseudoElementType(CSSPseudoElementType::mozColorSwatch);
|
||||
|
||||
// Mark the element to be native anonymous before setting any attributes.
|
||||
mColorContent->SetIsNativeAnonymousRoot();
|
||||
@@ -76,11 +77,7 @@ nsColorControlFrame::CreateAnonymousContent(nsTArray<ContentInfo>& aElements)
|
||||
nsresult rv = UpdateColor();
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
CSSPseudoElementType pseudoType = CSSPseudoElementType::mozColorSwatch;
|
||||
RefPtr<nsStyleContext> newStyleContext = PresContext()->StyleSet()->
|
||||
ResolvePseudoElementStyle(mContent->AsElement(), pseudoType,
|
||||
StyleContext(), mColorContent->AsElement());
|
||||
if (!aElements.AppendElement(ContentInfo(mColorContent, newStyleContext))) {
|
||||
if (!aElements.AppendElement(mColorContent)) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user