зеркало из https://github.com/mozilla/pjs.git
Bug 77716 Scrollbar is loading asynchronously! - Trunk [@ nsCSSFrameConstructor::ConstructDocElementFrame] [@ .__ptr_glue - nsCSSFrameConstructor::ContentInserted]
patch by hyatt r=jag,dbaron sr=bz, a=dbaron
This commit is contained in:
Родитель
fcc429a55d
Коммит
9c555262ba
|
@ -3331,21 +3331,27 @@ nsCSSFrameConstructor::ConstructDocElementFrame(nsIPresShell* aPresShell,
|
|||
// ----- reattach gfx scrollbars ------
|
||||
// Gfx scrollframes were created in the root frame but the primary frame map may have been destroyed if a
|
||||
// new style sheet was loaded so lets reattach the frames to their content.
|
||||
if (mGfxScrollFrame)
|
||||
{
|
||||
nsIFrame* scrollPort = nsnull;
|
||||
mGfxScrollFrame->FirstChild(aPresContext, nsnull, &scrollPort);
|
||||
if (mGfxScrollFrame) {
|
||||
nsIFrame* scrollPort = nsnull;
|
||||
mGfxScrollFrame->FirstChild(aPresContext, nsnull, &scrollPort);
|
||||
|
||||
nsIFrame* gfxScrollbarFrame1 = nsnull;
|
||||
nsIFrame* gfxScrollbarFrame2 = nsnull;
|
||||
nsresult rv = scrollPort->GetNextSibling(&gfxScrollbarFrame1);
|
||||
rv = gfxScrollbarFrame1->GetNextSibling(&gfxScrollbarFrame2);
|
||||
nsCOMPtr<nsIContent> content;
|
||||
gfxScrollbarFrame1->GetContent(getter_AddRefs(content));
|
||||
aState.mFrameManager->SetPrimaryFrameFor(content, gfxScrollbarFrame1);
|
||||
nsIFrame* gfxScrollbarFrame1 = nsnull;
|
||||
nsIFrame* gfxScrollbarFrame2 = nsnull;
|
||||
nsresult rv = scrollPort->GetNextSibling(&gfxScrollbarFrame1);
|
||||
if (gfxScrollbarFrame1) {
|
||||
nsCOMPtr<nsIContent> content;
|
||||
gfxScrollbarFrame1->GetContent(getter_AddRefs(content));
|
||||
// XXX This works, but why?
|
||||
aState.mFrameManager->SetPrimaryFrameFor(content, gfxScrollbarFrame1);
|
||||
|
||||
rv = gfxScrollbarFrame1->GetNextSibling(&gfxScrollbarFrame2);
|
||||
if (gfxScrollbarFrame2) {
|
||||
gfxScrollbarFrame2->GetContent(getter_AddRefs(content));
|
||||
// XXX This works, but why?
|
||||
aState.mFrameManager->SetPrimaryFrameFor(content, gfxScrollbarFrame2);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// --------- CREATE AREA OR BOX FRAME -------
|
||||
nsCOMPtr<nsIStyleContext> styleContext;
|
||||
|
|
|
@ -1085,7 +1085,7 @@ PRBool
|
|||
nsGfxScrollFrameInner::AddRemoveScrollbar(nsBoxLayoutState& aState, nsRect& aScrollAreaSize, PRBool aOnTop, PRBool aHorizontal, PRBool aAdd)
|
||||
{
|
||||
if (aHorizontal) {
|
||||
if (mNeverHasHorizontalScrollbar)
|
||||
if (mNeverHasHorizontalScrollbar || !mHScrollbarBox)
|
||||
return PR_FALSE;
|
||||
|
||||
if (aAdd)
|
||||
|
@ -1106,7 +1106,7 @@ nsGfxScrollFrameInner::AddRemoveScrollbar(nsBoxLayoutState& aState, nsRect& aScr
|
|||
|
||||
return fit;
|
||||
} else {
|
||||
if (mNeverHasVerticalScrollbar)
|
||||
if (mNeverHasVerticalScrollbar || !mVScrollbarBox)
|
||||
return PR_FALSE;
|
||||
|
||||
if (aAdd)
|
||||
|
@ -1646,6 +1646,9 @@ nsGfxScrollFrameInner::GetScrolledSize(nsIPresContext* aPresContext,
|
|||
void
|
||||
nsGfxScrollFrameInner::SetScrollbarVisibility(nsIBox* aScrollbar, PRBool aVisible)
|
||||
{
|
||||
if (!aScrollbar)
|
||||
return;
|
||||
|
||||
nsIFrame* frame = nsnull;
|
||||
aScrollbar->GetFrame(&frame);
|
||||
|
||||
|
|
|
@ -1085,7 +1085,7 @@ PRBool
|
|||
nsGfxScrollFrameInner::AddRemoveScrollbar(nsBoxLayoutState& aState, nsRect& aScrollAreaSize, PRBool aOnTop, PRBool aHorizontal, PRBool aAdd)
|
||||
{
|
||||
if (aHorizontal) {
|
||||
if (mNeverHasHorizontalScrollbar)
|
||||
if (mNeverHasHorizontalScrollbar || !mHScrollbarBox)
|
||||
return PR_FALSE;
|
||||
|
||||
if (aAdd)
|
||||
|
@ -1106,7 +1106,7 @@ nsGfxScrollFrameInner::AddRemoveScrollbar(nsBoxLayoutState& aState, nsRect& aScr
|
|||
|
||||
return fit;
|
||||
} else {
|
||||
if (mNeverHasVerticalScrollbar)
|
||||
if (mNeverHasVerticalScrollbar || !mVScrollbarBox)
|
||||
return PR_FALSE;
|
||||
|
||||
if (aAdd)
|
||||
|
@ -1646,6 +1646,9 @@ nsGfxScrollFrameInner::GetScrolledSize(nsIPresContext* aPresContext,
|
|||
void
|
||||
nsGfxScrollFrameInner::SetScrollbarVisibility(nsIBox* aScrollbar, PRBool aVisible)
|
||||
{
|
||||
if (!aScrollbar)
|
||||
return;
|
||||
|
||||
nsIFrame* frame = nsnull;
|
||||
aScrollbar->GetFrame(&frame);
|
||||
|
||||
|
|
|
@ -3331,21 +3331,27 @@ nsCSSFrameConstructor::ConstructDocElementFrame(nsIPresShell* aPresShell,
|
|||
// ----- reattach gfx scrollbars ------
|
||||
// Gfx scrollframes were created in the root frame but the primary frame map may have been destroyed if a
|
||||
// new style sheet was loaded so lets reattach the frames to their content.
|
||||
if (mGfxScrollFrame)
|
||||
{
|
||||
nsIFrame* scrollPort = nsnull;
|
||||
mGfxScrollFrame->FirstChild(aPresContext, nsnull, &scrollPort);
|
||||
if (mGfxScrollFrame) {
|
||||
nsIFrame* scrollPort = nsnull;
|
||||
mGfxScrollFrame->FirstChild(aPresContext, nsnull, &scrollPort);
|
||||
|
||||
nsIFrame* gfxScrollbarFrame1 = nsnull;
|
||||
nsIFrame* gfxScrollbarFrame2 = nsnull;
|
||||
nsresult rv = scrollPort->GetNextSibling(&gfxScrollbarFrame1);
|
||||
rv = gfxScrollbarFrame1->GetNextSibling(&gfxScrollbarFrame2);
|
||||
nsCOMPtr<nsIContent> content;
|
||||
gfxScrollbarFrame1->GetContent(getter_AddRefs(content));
|
||||
aState.mFrameManager->SetPrimaryFrameFor(content, gfxScrollbarFrame1);
|
||||
nsIFrame* gfxScrollbarFrame1 = nsnull;
|
||||
nsIFrame* gfxScrollbarFrame2 = nsnull;
|
||||
nsresult rv = scrollPort->GetNextSibling(&gfxScrollbarFrame1);
|
||||
if (gfxScrollbarFrame1) {
|
||||
nsCOMPtr<nsIContent> content;
|
||||
gfxScrollbarFrame1->GetContent(getter_AddRefs(content));
|
||||
// XXX This works, but why?
|
||||
aState.mFrameManager->SetPrimaryFrameFor(content, gfxScrollbarFrame1);
|
||||
|
||||
rv = gfxScrollbarFrame1->GetNextSibling(&gfxScrollbarFrame2);
|
||||
if (gfxScrollbarFrame2) {
|
||||
gfxScrollbarFrame2->GetContent(getter_AddRefs(content));
|
||||
// XXX This works, but why?
|
||||
aState.mFrameManager->SetPrimaryFrameFor(content, gfxScrollbarFrame2);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// --------- CREATE AREA OR BOX FRAME -------
|
||||
nsCOMPtr<nsIStyleContext> styleContext;
|
||||
|
|
Загрузка…
Ссылка в новой задаче