mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-08-15 08:53:07 +09:00
Bug 1331322 - Allow tagging of pseudo-implementing native anonymous content with the pseudo type at creation time
* Stop using a node bit for HasExplicitBaseURI * Move MAY_HAVE_CLASS to mBoolFlags * Add a flag to indicate that a node is native anonymous content * Allow tagging of pseudo-implementing native anonymous content with the pseudo type at creation time, and eliminate explicit style contexts in nsIAnonymousContentCreator::ContentInfo Tag #1375
This commit is contained in:
parent
31048968fd
commit
b723a5c8c4
25 changed files with 267 additions and 128 deletions
|
|
@ -67,6 +67,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();
|
||||
|
|
@ -74,11 +75,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;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue