зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1290335: Reuse the OverflowChangedTracker between both restyle managers. r=heycam
MozReview-Commit-ID: objnqfecZD
This commit is contained in:
Родитель
5011eb626b
Коммит
789c630dba
|
@ -105,12 +105,6 @@ RestyleManager::RestyleManager(nsPresContext* aPresContext)
|
|||
mPendingRestyles.Init(this);
|
||||
}
|
||||
|
||||
void
|
||||
RestyleManager::NotifyDestroyingFrame(nsIFrame* aFrame)
|
||||
{
|
||||
mOverflowChangedTracker.RemoveFrame(aFrame);
|
||||
}
|
||||
|
||||
void
|
||||
RestyleManager::RestyleElement(Element* aElement,
|
||||
nsIFrame* aPrimaryFrame,
|
||||
|
|
|
@ -57,10 +57,6 @@ private:
|
|||
public:
|
||||
NS_INLINE_DECL_REFCOUNTING(mozilla::RestyleManager)
|
||||
|
||||
// Should be called when a frame is going to be destroyed and
|
||||
// WillDestroyFrameTree hasn't been called yet.
|
||||
void NotifyDestroyingFrame(nsIFrame* aFrame);
|
||||
|
||||
// Forwarded nsIDocumentObserver method, to handle restyling (and
|
||||
// passing the notification to the frame).
|
||||
nsresult ContentStateChanged(nsIContent* aContent,
|
||||
|
@ -395,11 +391,6 @@ public:
|
|||
PostRestyleEventInternal(true);
|
||||
}
|
||||
|
||||
void FlushOverflowChangedTracker()
|
||||
{
|
||||
mOverflowChangedTracker.Flush();
|
||||
}
|
||||
|
||||
#ifdef DEBUG
|
||||
static nsCString ChangeHintToString(nsChangeHint aHint);
|
||||
#endif
|
||||
|
@ -519,8 +510,6 @@ private:
|
|||
nsChangeHint mRebuildAllExtraHint;
|
||||
nsRestyleHint mRebuildAllRestyleHint;
|
||||
|
||||
OverflowChangedTracker mOverflowChangedTracker;
|
||||
|
||||
// The total number of animation flushes by this frame constructor.
|
||||
// Used to keep the layer and animation manager in sync.
|
||||
uint64_t mAnimationGeneration;
|
||||
|
|
|
@ -7,13 +7,13 @@
|
|||
#ifndef mozilla_RestyleManagerBase_h
|
||||
#define mozilla_RestyleManagerBase_h
|
||||
|
||||
#include "mozilla/OverflowChangedTracker.h"
|
||||
#include "nsChangeHint.h"
|
||||
|
||||
class nsStyleChangeList;
|
||||
|
||||
namespace mozilla {
|
||||
|
||||
class OverflowChangedTracker;
|
||||
class ServoRestyleManager;
|
||||
class RestyleManager;
|
||||
|
||||
|
@ -54,6 +54,16 @@ public:
|
|||
static void DebugVerifyStyleTree(nsIFrame* aFrame);
|
||||
#endif
|
||||
|
||||
void FlushOverflowChangedTracker() {
|
||||
mOverflowChangedTracker.Flush();
|
||||
}
|
||||
|
||||
// Should be called when a frame is going to be destroyed and
|
||||
// WillDestroyFrameTree hasn't been called yet.
|
||||
void NotifyDestroyingFrame(nsIFrame* aFrame) {
|
||||
mOverflowChangedTracker.RemoveFrame(aFrame);
|
||||
}
|
||||
|
||||
protected:
|
||||
void ContentStateChangedInternal(Element* aElement,
|
||||
EventStates aStateMask,
|
||||
|
@ -103,11 +113,13 @@ private:
|
|||
// True if we're already waiting for a refresh notification.
|
||||
bool mObservingRefreshDriver;
|
||||
|
||||
protected:
|
||||
OverflowChangedTracker mOverflowChangedTracker;
|
||||
|
||||
/**
|
||||
* These are protected static methods that help with the change hint
|
||||
* processing bits of the restyle managers.
|
||||
*/
|
||||
protected:
|
||||
static nsIFrame*
|
||||
GetNearestAncestorFrame(nsIContent* aContent);
|
||||
|
||||
|
|
|
@ -140,6 +140,7 @@ public:
|
|||
inline void SetObservingRefreshDriver(bool aObserving);
|
||||
inline nsresult ProcessRestyledFrames(nsStyleChangeList& aChangeList);
|
||||
inline void FlushOverflowChangedTracker();
|
||||
inline void NotifyDestroyingFrame(nsIFrame* aFrame);
|
||||
|
||||
private:
|
||||
// Stores a pointer to an RestyleManager or a ServoRestyleManager. The least
|
||||
|
|
|
@ -167,6 +167,11 @@ RestyleManagerHandle::Ptr::SetObservingRefreshDriver(bool aObserving)
|
|||
FORWARD(SetObservingRefreshDriver, (aObserving));
|
||||
}
|
||||
|
||||
void
|
||||
RestyleManagerHandle::Ptr::NotifyDestroyingFrame(nsIFrame* aFrame)
|
||||
{
|
||||
FORWARD(NotifyDestroyingFrame, (aFrame));
|
||||
}
|
||||
|
||||
} // namespace mozilla
|
||||
|
||||
|
|
|
@ -367,17 +367,8 @@ ServoRestyleManager::SnapshotForElement(Element* aElement)
|
|||
nsresult
|
||||
ServoRestyleManager::ProcessRestyledFrames(nsStyleChangeList& aChangeList)
|
||||
{
|
||||
// XXX Hook the overflow tracker somewhere.
|
||||
OverflowChangedTracker overflowChangedTracker;
|
||||
return base_type::ProcessRestyledFrames(aChangeList, *PresContext(),
|
||||
overflowChangedTracker);
|
||||
}
|
||||
|
||||
void
|
||||
ServoRestyleManager::FlushOverflowChangedTracker()
|
||||
{
|
||||
MOZ_CRASH("stylo: ServoRestyleManager::FlushOverflowChangedTracker "
|
||||
"not implemented for Servo-backed style system");
|
||||
mOverflowChangedTracker);
|
||||
}
|
||||
|
||||
} // namespace mozilla
|
||||
|
|
|
@ -75,7 +75,6 @@ public:
|
|||
|
||||
nsresult ReparentStyleContext(nsIFrame* aFrame);
|
||||
nsresult ProcessRestyledFrames(nsStyleChangeList& aChangeList);
|
||||
void FlushOverflowChangedTracker();
|
||||
|
||||
bool HasPendingRestyles() { return !mModifiedElements.IsEmpty(); }
|
||||
|
||||
|
|
|
@ -1611,11 +1611,7 @@ nsCSSFrameConstructor::NotifyDestroyingFrame(nsIFrame* aFrame)
|
|||
CountersDirty();
|
||||
}
|
||||
|
||||
// stylo: ServoRestyleManager does not need to be notified of frames being
|
||||
// destroyed.
|
||||
if (mozilla::RestyleManager* geckoRM = RestyleManager()->GetAsGecko()) {
|
||||
geckoRM->NotifyDestroyingFrame(aFrame);
|
||||
}
|
||||
RestyleManager()->NotifyDestroyingFrame(aFrame);
|
||||
|
||||
nsFrameManager::NotifyDestroyingFrame(aFrame);
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче