mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Re-checkin fix for bug 399863. We frequently call InitialUpdate() more than once on SVG frames. r=tor@acm.org, sr+a1.9=roc@ocallahan.org
This commit is contained in:
parent
a85b754e08
commit
d8ce604db7
@ -76,7 +76,13 @@ public:
|
||||
|
||||
NS_IMETHOD_(nsRect) GetCoveredRegion()=0;
|
||||
NS_IMETHOD UpdateCoveredRegion()=0;
|
||||
|
||||
// Called once on all SVG child frames, either when their nsSVGOuterSVGFrame
|
||||
// receives its initial reflow (i.e. once the SVG viewport dimensions are
|
||||
// known), or else when they're inserted into the frame tree (if they're
|
||||
// inserted after the initial reflow).
|
||||
NS_IMETHOD InitialUpdate()=0;
|
||||
|
||||
NS_IMETHOD NotifyCanvasTMChanged(PRBool suppressInvalidation)=0;
|
||||
NS_IMETHOD NotifyRedrawSuspended()=0;
|
||||
NS_IMETHOD NotifyRedrawUnsuspended()=0;
|
||||
|
@ -125,20 +125,23 @@ nsSVGDisplayContainerFrame::InsertFrames(nsIAtom* aListName,
|
||||
// Insert the new frames
|
||||
nsSVGContainerFrame::InsertFrames(aListName, aPrevFrame, aFrameList);
|
||||
|
||||
// call InitialUpdate() on all new frames:
|
||||
nsIFrame* end = nsnull;
|
||||
if (lastNewFrame)
|
||||
end = lastNewFrame->GetNextSibling();
|
||||
|
||||
for (nsIFrame* kid = aFrameList; kid != end;
|
||||
kid = kid->GetNextSibling()) {
|
||||
nsISVGChildFrame* SVGFrame=nsnull;
|
||||
CallQueryInterface(kid, &SVGFrame);
|
||||
if (SVGFrame) {
|
||||
SVGFrame->InitialUpdate();
|
||||
// Call InitialUpdate on the new frames ONLY if our nsSVGOuterSVGFrame has had
|
||||
// its initial reflow (our NS_FRAME_FIRST_REFLOW bit is clear) - bug 399863.
|
||||
if (!(GetStateBits() & NS_FRAME_FIRST_REFLOW)) {
|
||||
nsIFrame* end = nsnull;
|
||||
if (lastNewFrame)
|
||||
end = lastNewFrame->GetNextSibling();
|
||||
|
||||
for (nsIFrame* kid = aFrameList; kid != end;
|
||||
kid = kid->GetNextSibling()) {
|
||||
nsISVGChildFrame* SVGFrame = nsnull;
|
||||
CallQueryInterface(kid, &SVGFrame);
|
||||
if (SVGFrame) {
|
||||
SVGFrame->InitialUpdate();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
@ -214,6 +217,10 @@ nsSVGDisplayContainerFrame::UpdateCoveredRegion()
|
||||
NS_IMETHODIMP
|
||||
nsSVGDisplayContainerFrame::InitialUpdate()
|
||||
{
|
||||
NS_ASSERTION(GetStateBits() & NS_FRAME_FIRST_REFLOW,
|
||||
"Yikes! We've been called already! Hopefully we weren't called "
|
||||
"before our nsSVGOuterSVGFrame's initial Reflow()!!!");
|
||||
|
||||
for (nsIFrame* kid = mFrames.FirstChild(); kid;
|
||||
kid = kid->GetNextSibling()) {
|
||||
nsISVGChildFrame* SVGFrame = nsnull;
|
||||
|
@ -365,6 +365,10 @@ nsSVGForeignObjectFrame::UpdateCoveredRegion()
|
||||
NS_IMETHODIMP
|
||||
nsSVGForeignObjectFrame::InitialUpdate()
|
||||
{
|
||||
NS_ASSERTION(GetStateBits() & NS_FRAME_FIRST_REFLOW,
|
||||
"Yikes! We've been called already! Hopefully we weren't called "
|
||||
"before our nsSVGOuterSVGFrame's initial Reflow()!!!");
|
||||
|
||||
UpdateCoveredRegion();
|
||||
DoReflow();
|
||||
|
||||
@ -585,6 +589,10 @@ nsSVGForeignObjectFrame::DoReflow()
|
||||
printf("**nsSVGForeignObjectFrame::DoReflow()\n");
|
||||
#endif
|
||||
|
||||
NS_ASSERTION(!(nsSVGUtils::GetOuterSVGFrame(this)->
|
||||
GetStateBits() & NS_FRAME_FIRST_REFLOW),
|
||||
"Calling InitialUpdate too early - must not call DoReflow!!!");
|
||||
|
||||
if (IsDisabled())
|
||||
return;
|
||||
|
||||
|
@ -461,6 +461,10 @@ nsSVGGlyphFrame::UpdateCoveredRegion()
|
||||
NS_IMETHODIMP
|
||||
nsSVGGlyphFrame::InitialUpdate()
|
||||
{
|
||||
NS_ASSERTION(GetStateBits() & NS_FRAME_FIRST_REFLOW,
|
||||
"Yikes! We've been called already! Hopefully we weren't called "
|
||||
"before our nsSVGOuterSVGFrame's initial Reflow()!!!");
|
||||
|
||||
NS_ASSERTION(!(mState & NS_FRAME_IN_REFLOW),
|
||||
"We don't actually participate in reflow");
|
||||
|
||||
|
@ -444,6 +444,10 @@ nsSVGPathGeometryFrame::UpdateCoveredRegion()
|
||||
NS_IMETHODIMP
|
||||
nsSVGPathGeometryFrame::InitialUpdate()
|
||||
{
|
||||
NS_ASSERTION(GetStateBits() & NS_FRAME_FIRST_REFLOW,
|
||||
"Yikes! We've been called already! Hopefully we weren't called "
|
||||
"before our nsSVGOuterSVGFrame's initial Reflow()!!!");
|
||||
|
||||
UpdateGraphic();
|
||||
|
||||
NS_ASSERTION(!(mState & NS_FRAME_IN_REFLOW),
|
||||
|
Loading…
Reference in New Issue
Block a user