зеркало из https://github.com/mozilla/pjs.git
Make all stylesheet changes do an async style reresolve, not a sync one. Bug
314776, r+sr=dbaron
This commit is contained in:
Родитель
f623374103
Коммит
d8196b6b42
|
@ -13250,6 +13250,10 @@ nsCSSFrameConstructor::ProcessPendingRestyles()
|
|||
}
|
||||
|
||||
delete [] restylesToProcess;
|
||||
|
||||
#ifdef DEBUG
|
||||
mPresShell->VerifyStyleTree();
|
||||
#endif
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
@ -91,8 +91,8 @@ class nsCSSFrameConstructor;
|
|||
class nsISelection;
|
||||
|
||||
#define NS_IPRESSHELL_IID \
|
||||
{ 0x8be1b911, 0x7a04, 0x44e8, \
|
||||
{ 0xaf, 0xaa, 0x17, 0x77, 0x26, 0x91, 0x8c, 0x19 } }
|
||||
{ 0x759ceea6, 0x52c1, 0x4a39, \
|
||||
{ 0x9f, 0xca, 0x1d, 0xf9, 0x9f, 0x40, 0xc9, 0xd3 } }
|
||||
|
||||
// Constants uses for ScrollFrameIntoView() function
|
||||
#define NS_PRESSHELL_SCROLL_TOP 0
|
||||
|
@ -209,7 +209,12 @@ public:
|
|||
/*
|
||||
* Called when stylesheets are added/removed/enabled/disabled to rebuild
|
||||
* all style data for a given pres shell without necessarily reconstructing
|
||||
* all of the frames.
|
||||
* all of the frames. This will not reconstruct style synchronously; if
|
||||
* you need to do that, call FlushPendingNotifications to flush out style
|
||||
* reresolves.
|
||||
* // XXXbz why do we have this on the interface anyway? The only consumer
|
||||
* is calling AddOverrideStyleSheet/RemoveOverrideStyleSheet, and I think
|
||||
* those should just handle reconstructing style data...
|
||||
*/
|
||||
virtual NS_HIDDEN_(void) ReconstructStyleDataExternal();
|
||||
NS_HIDDEN_(void) ReconstructStyleDataInternal();
|
||||
|
@ -672,6 +677,7 @@ public:
|
|||
PRInt32 aIndent = 0) = 0;
|
||||
|
||||
virtual void ListStyleSheets(FILE *out, PRInt32 aIndent = 0) = 0;
|
||||
virtual void VerifyStyleTree() = 0;
|
||||
#endif
|
||||
|
||||
PRBool IsAccessibilityActive() { return mIsAccessibilityActive; }
|
||||
|
@ -717,6 +723,7 @@ protected:
|
|||
nsWeakPtr mForwardingContainer;
|
||||
|
||||
PRPackedBool mStylesHaveChanged;
|
||||
PRPackedBool mDidInitialReflow;
|
||||
|
||||
#ifdef ACCESSIBILITY
|
||||
/**
|
||||
|
|
|
@ -1260,6 +1260,7 @@ public:
|
|||
PRInt32 aIndent = 0);
|
||||
|
||||
virtual void ListStyleSheets(FILE *out, PRInt32 aIndent = 0);
|
||||
virtual void VerifyStyleTree();
|
||||
#endif
|
||||
|
||||
#ifdef PR_LOGGING
|
||||
|
@ -1342,7 +1343,6 @@ protected:
|
|||
PRPackedBool mIsDestroying;
|
||||
PRPackedBool mIsReleasingAnonymousContent;
|
||||
|
||||
PRPackedBool mDidInitialReflow;
|
||||
PRPackedBool mIgnoreFrameDestruction;
|
||||
PRPackedBool mHaveShutDown;
|
||||
|
||||
|
@ -1447,7 +1447,7 @@ VerifyStyleTree(nsPresContext* aPresContext, nsFrameManager* aFrameManager)
|
|||
aFrameManager->DebugVerifyStyleTree(rootFrame);
|
||||
}
|
||||
}
|
||||
#define VERIFY_STYLE_TREE VerifyStyleTree(mPresContext, FrameManager())
|
||||
#define VERIFY_STYLE_TREE ::VerifyStyleTree(mPresContext, FrameManager())
|
||||
#else
|
||||
#define VERIFY_STYLE_TREE
|
||||
#endif
|
||||
|
@ -5208,20 +5208,18 @@ nsIPresShell::ReconstructStyleDataInternal()
|
|||
{
|
||||
mStylesHaveChanged = PR_FALSE;
|
||||
|
||||
nsIFrame* rootFrame = FrameManager()->GetRootFrame();
|
||||
if (!rootFrame)
|
||||
if (!mDidInitialReflow) {
|
||||
// Nothing to do here, since we have no frames yet
|
||||
return;
|
||||
}
|
||||
|
||||
nsStyleChangeList changeList;
|
||||
FrameManager()->ComputeStyleChangeFor(rootFrame, &changeList,
|
||||
NS_STYLE_HINT_NONE);
|
||||
|
||||
NS_ASSERTION(mViewManager, "Should have view manager");
|
||||
mViewManager->BeginUpdateViewBatch();
|
||||
mFrameConstructor->ProcessRestyledFrames(changeList);
|
||||
mViewManager->EndUpdateViewBatch(NS_VMREFRESH_NO_SYNC);
|
||||
|
||||
VERIFY_STYLE_TREE;
|
||||
nsIContent* root = mDocument->GetRootContent();
|
||||
if (!root) {
|
||||
// No content to restyle
|
||||
return;
|
||||
}
|
||||
|
||||
mFrameConstructor->PostRestyleEvent(root, eReStyle_Self, NS_STYLE_HINT_NONE);
|
||||
|
||||
#ifdef ACCESSIBILITY
|
||||
InvalidateAccessibleSubtree(nsnull);
|
||||
|
@ -7272,6 +7270,11 @@ PresShell::ListStyleSheets(FILE *out, PRInt32 aIndent)
|
|||
}
|
||||
}
|
||||
|
||||
void
|
||||
PresShell::VerifyStyleTree()
|
||||
{
|
||||
VERIFY_STYLE_TREE;
|
||||
}
|
||||
#endif
|
||||
|
||||
// PresShellViewEventListener
|
||||
|
|
Загрузка…
Ссылка в новой задаче