Bug 670564 - "ASSERTION: illegal left edge" in nsDisplayText::Paint. r=roc

This commit is contained in:
Mats Palmgren 2011-07-11 22:18:26 +02:00
parent 8f3490e2d0
commit 4521458b36

View File

@ -556,10 +556,20 @@ TextOverflow::PruneDisplayListContents(nsDisplayList* aList,
nsRect rect = itemFrame->GetScrollableOverflowRect() +
itemFrame->GetOffsetTo(mBlock);
if (mLeft.IsNeeded() && rect.x < aInsideMarkersArea.x) {
charClip->mLeftEdge = aInsideMarkersArea.x - rect.x;
nscoord left = aInsideMarkersArea.x - rect.x;
if (NS_UNLIKELY(left < 0)) {
item->~nsDisplayItem();
continue;
}
charClip->mLeftEdge = left;
}
if (mRight.IsNeeded() && rect.XMost() > aInsideMarkersArea.XMost()) {
charClip->mRightEdge = rect.XMost() - aInsideMarkersArea.XMost();
nscoord right = rect.XMost() - aInsideMarkersArea.XMost();
if (NS_UNLIKELY(right < 0)) {
item->~nsDisplayItem();
continue;
}
charClip->mRightEdge = right;
}
}