зеркало из https://github.com/mozilla/pjs.git
Bug 654990 - Don't use SetInitialChildList to specify the style context of the progress bar anonymous child. r=bz
This commit is contained in:
Родитель
78037a5874
Коммит
403881e7d7
|
@ -71,30 +71,6 @@ nsProgressFrame::~nsProgressFrame()
|
|||
{
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsProgressFrame::SetInitialChildList(nsIAtom* aListName,
|
||||
nsFrameList& aChildList)
|
||||
{
|
||||
NS_ASSERTION(mBarDiv, "Progress bar div must exist!");
|
||||
|
||||
nsresult rv = nsHTMLContainerFrame::SetInitialChildList(aListName,
|
||||
aChildList);
|
||||
|
||||
nsIFrame* barFrame = mBarDiv->GetPrimaryFrame();
|
||||
nsCSSPseudoElements::Type pseudoType = nsCSSPseudoElements::ePseudo_mozProgressBar;
|
||||
nsRefPtr<nsStyleContext> newStyleContext;
|
||||
|
||||
newStyleContext = barFrame->PresContext()->StyleSet()->
|
||||
ResolvePseudoElementStyle(mContent->AsElement(), pseudoType,
|
||||
barFrame->GetParent()->GetStyleContext());
|
||||
|
||||
if (newStyleContext) {
|
||||
barFrame->SetStyleContext(newStyleContext);
|
||||
}
|
||||
|
||||
return rv;
|
||||
}
|
||||
|
||||
void
|
||||
nsProgressFrame::DestroyFrom(nsIFrame* aDestructRoot)
|
||||
{
|
||||
|
@ -122,7 +98,13 @@ nsProgressFrame::CreateAnonymousContent(nsTArray<ContentInfo>& aElements)
|
|||
mozilla::dom::NOT_FROM_PARSER);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
if (!aElements.AppendElement(mBarDiv)) {
|
||||
// Associate ::-moz-progress-bar pseudo-element to the anonymous child.
|
||||
nsCSSPseudoElements::Type pseudoType = nsCSSPseudoElements::ePseudo_mozProgressBar;
|
||||
nsRefPtr<nsStyleContext> newStyleContext = PresContext()->StyleSet()->
|
||||
ResolvePseudoElementStyle(mContent->AsElement(), pseudoType,
|
||||
GetStyleContext());
|
||||
|
||||
if (!aElements.AppendElement(ContentInfo(mBarDiv, newStyleContext))) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
|
||||
|
|
|
@ -54,9 +54,6 @@ public:
|
|||
nsProgressFrame(nsStyleContext* aContext);
|
||||
virtual ~nsProgressFrame();
|
||||
|
||||
NS_IMETHOD SetInitialChildList(nsIAtom* aListName,
|
||||
nsFrameList& aChildList);
|
||||
|
||||
virtual void DestroyFrom(nsIFrame* aDestructRoot);
|
||||
|
||||
NS_IMETHOD Reflow(nsPresContext* aCX,
|
||||
|
|
Загрузка…
Ссылка в новой задаче