No issue - Fix some fatal printing assertions.

- Turn a fatal assert into a warning if we can't guarantee a drawTarget.
  This should not be fatal since the DrawTarget is checked later.
- Remove a fatal assertion if a display table background is cross-document
  since non-display iframes may cause this situation without it being an
  error.
This commit is contained in:
Moonchild 2026-03-09 11:30:38 +01:00 committed by OwnedByWuigi
commit 77b07ceb5e
2 changed files with 1 additions and 4 deletions

View file

@ -58,7 +58,7 @@ PrintTarget::MakeDrawTarget(const IntSize& aSize,
// This should not be called outside of BeginPage()/EndPage() calls since
// some backends can only provide a valid DrawTarget at that time.
MOZ_ASSERT(mHasActivePage, "We can't guarantee a valid DrawTarget");
NS_WARNING_ASSERTION(mHasActivePage, "We can't guarantee a valid DrawTarget without an active page. Content may be missing.");
if (cairo_surface_status(mCairoSurface)) {
return nullptr;

View file

@ -81,9 +81,6 @@ class nsDisplayTableBackgroundSet {
nsDisplayTableBackgroundSet(nsDisplayListBuilder* aBuilder, nsIFrame* aTable)
: mBuilder(aBuilder) {
mPrevTableBackgroundSet = mBuilder->SetTableBackgroundSet(this);
mozilla::DebugOnly<const nsIFrame*> reference =
mBuilder->FindReferenceFrameFor(aTable, &mToReferenceFrame);
MOZ_ASSERT(nsLayoutUtils::IsAncestorFrameCrossDoc(reference, aTable));
mDirtyRect = mBuilder->GetDirtyRect();
}