Bug 1110277 patch 7 - Call CreateNeededFrames from ~ReframingStyleContexts. r=bzbarsky

I don't have any tests that exercise this code, and I can't even find a
codepath that demonstrates that it's needed, since the lazy
reconstruction that happens during style-triggered frame reconstruction
all appears to go through PostRestyleEvent rather than
MaybeConstructLazily.

But I think we should either do this or add an assertion that it's not
needed, and given that it's one line, it seems like we may as well just
do it.  (Note also that we're currently calling CreateNeededFrames at
the start of style reresolution, in
RestyleManager::ProcessPendingRestyles; this adds a call at the end.)
This commit is contained in:
L. David Baron 2015-01-13 21:03:13 -08:00
Родитель f290869b5e
Коммит c90d6e2a33
2 изменённых файлов: 12 добавлений и 1 удалений

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

@ -995,6 +995,16 @@ RestyleManager::ReframingStyleContexts::ReframingStyleContexts(
mRestyleManager->mReframingStyleContexts = this; mRestyleManager->mReframingStyleContexts = this;
} }
RestyleManager::ReframingStyleContexts::~ReframingStyleContexts()
{
// Before we go away, we need to flush out any frame construction that
// was enqueued, so that we start transitions.
// Note that this is a little bit evil in that we're calling into code
// that calls our member functions from our destructor, but it's at
// the beginning of our destructor, so it shouldn't be too bad.
mRestyleManager->mPresContext->FrameConstructor()->CreateNeededFrames();
}
static inline dom::Element* static inline dom::Element*
ElementForStyleContext(nsIContent* aParentContent, ElementForStyleContext(nsIContent* aParentContent,
nsIFrame* aFrame, nsIFrame* aFrame,

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

@ -181,7 +181,7 @@ public:
*/ */
typedef nsRefPtrHashtable<nsRefPtrHashKey<nsIContent>, nsStyleContext> typedef nsRefPtrHashtable<nsRefPtrHashKey<nsIContent>, nsStyleContext>
ReframingStyleContextTable; ReframingStyleContextTable;
class MOZ_STACK_CLASS ReframingStyleContexts { class MOZ_STACK_CLASS ReframingStyleContexts MOZ_FINAL {
public: public:
/** /**
* Construct a ReframingStyleContexts object. The caller must * Construct a ReframingStyleContexts object. The caller must
@ -190,6 +190,7 @@ public:
* method of RestyleManager.) * method of RestyleManager.)
*/ */
explicit ReframingStyleContexts(RestyleManager* aRestyleManager); explicit ReframingStyleContexts(RestyleManager* aRestyleManager);
~ReframingStyleContexts();
void Put(nsIContent* aContent, nsStyleContext* aStyleContext) { void Put(nsIContent* aContent, nsStyleContext* aStyleContext) {
MOZ_ASSERT(aContent); MOZ_ASSERT(aContent);