Bug 625289 patch 7 - Expose TryStartingTransition. r=heycam

This commit is contained in:
L. David Baron 2014-08-13 15:39:01 -07:00
Родитель ebafb4f9b6
Коммит e425638f17
2 изменённых файлов: 21 добавлений и 6 удалений

Просмотреть файл

@ -1821,10 +1821,12 @@ RestyleManager::DebugVerifyStyleTree(nsIFrame* aFrame)
// aContent must be the content for the frame in question, which may be
// :before/:after content
static void
TryStartingTransition(nsPresContext *aPresContext, nsIContent *aContent,
nsStyleContext *aOldStyleContext,
nsRefPtr<nsStyleContext> *aNewStyleContext /* inout */)
/* static */ void
RestyleManager::TryStartingTransition(nsPresContext* aPresContext,
nsIContent* aContent,
nsStyleContext* aOldStyleContext,
nsRefPtr<nsStyleContext>*
aNewStyleContext /* inout */)
{
if (!aContent || !aContent->IsElement()) {
return;
@ -2608,8 +2610,8 @@ ElementRestyler::RestyleSelf(nsIFrame* aSelf, nsRestyleHint aRestyleHint)
if (newContext != oldContext) {
if (!copyFromContinuation) {
TryStartingTransition(mPresContext, aSelf->GetContent(),
oldContext, &newContext);
RestyleManager::TryStartingTransition(mPresContext, aSelf->GetContent(),
oldContext, &newContext);
CaptureChange(oldContext, newContext, assumeDifferenceHint);
}

Просмотреть файл

@ -176,6 +176,19 @@ public:
return mReframingStyleContexts;
}
/**
* Try starting a transition for an element or a ::before or ::after
* pseudo-element, given an old and new style context. This may
* change the new style context if a transition is started.
*
* For the pseudo-elements, aContent must be the anonymous content
* that we're creating for that pseudo-element, not the real element.
*/
static void
TryStartingTransition(nsPresContext* aPresContext, nsIContent* aContent,
nsStyleContext* aOldStyleContext,
nsRefPtr<nsStyleContext>* aNewStyleContext /* inout */);
private:
void RestyleForEmptyChange(Element* aContainer);