Bug 410229. Handle IB special-siblings when we're finding all the CSS boxes for an element for getBoundingClientRect/getClientRects. r+sr=mats

This commit is contained in:
2008-01-03 17:50:30 -08:00
parent aaab649ce8
commit 8a19d885d9
4 changed files with 115 additions and 5 deletions

View File

@@ -803,9 +803,7 @@ nsNSElementTearoff::GetBoundingClientRect(nsIDOMTextRectangle** aResult)
if (TryGetSVGBoundingRect(frame, &r)) {
// Currently SVG frames don't have continuations but I don't want things to
// break if that changes.
nsIFrame* next;
while ((next = frame->GetNextContinuation()) != nsnull) {
frame = next;
while ((frame = nsLayoutUtils::GetNextContinuationOrSpecialSibling(frame)) != nsnull) {
nsRect nextRect;
#ifdef DEBUG
PRBool isSVG =
@@ -839,7 +837,8 @@ nsNSElementTearoff::GetClientRects(nsIDOMTextRectangleList** aResult)
}
nsPresContext* presContext = frame->PresContext();
for (nsIFrame* f = frame; f; f = f->GetNextContinuation()) {
for (nsIFrame* f = frame; f;
f = nsLayoutUtils::GetNextContinuationOrSpecialSibling(f)) {
nsRefPtr<nsTextRectangle> rect = new nsTextRectangle();
if (!rect)
return NS_ERROR_OUT_OF_MEMORY;