From: L. David Baron Remove duplicate null check. (Bug 747231, patch 1) diff --git a/dom/base/nsDOMWindowUtils.cpp b/dom/base/nsDOMWindowUtils.cpp --- a/dom/base/nsDOMWindowUtils.cpp +++ b/dom/base/nsDOMWindowUtils.cpp @@ -290,17 +290,17 @@ nsDOMWindowUtils::SetDisplayPortForEleme { if (!IsUniversalXPConnectCapable()) { return NS_ERROR_DOM_SECURITY_ERR; } nsIPresShell* presShell = GetPresShell(); if (!presShell) { return NS_ERROR_FAILURE; - } + } nsRect displayport(nsPresContext::CSSPixelsToAppUnits(aXPx), nsPresContext::CSSPixelsToAppUnits(aYPx), nsPresContext::CSSPixelsToAppUnits(aWidthPx), nsPresContext::CSSPixelsToAppUnits(aHeightPx)); if (!aElement) { return NS_ERROR_INVALID_ARG; @@ -342,40 +342,38 @@ nsDOMWindowUtils::SetDisplayPortForEleme nsIView* view = rootFrame->GetView(); if (view) { view->SetInvalidationDimensions(&displayport); } } } } - if (presShell) { - nsIFrame* rootFrame = presShell->FrameManager()->GetRootFrame(); - if (rootFrame) { - nsIContent* rootContent = - rootScrollFrame ? rootScrollFrame->GetContent() : nsnull; - nsRect rootDisplayport; - bool usingDisplayport = rootContent && - nsLayoutUtils::GetDisplayPort(rootContent, &rootDisplayport); - rootFrame->InvalidateWithFlags( - usingDisplayport ? rootDisplayport : rootFrame->GetVisualOverflowRect(), - nsIFrame::INVALIDATE_NO_THEBES_LAYERS); + nsIFrame* rootFrame = presShell->FrameManager()->GetRootFrame(); + if (rootFrame) { + nsIContent* rootContent = + rootScrollFrame ? rootScrollFrame->GetContent() : nsnull; + nsRect rootDisplayport; + bool usingDisplayport = rootContent && + nsLayoutUtils::GetDisplayPort(rootContent, &rootDisplayport); + rootFrame->InvalidateWithFlags( + usingDisplayport ? rootDisplayport : rootFrame->GetVisualOverflowRect(), + nsIFrame::INVALIDATE_NO_THEBES_LAYERS); - // Send empty paint transaction in order to release retained layers - if (displayport.IsEmpty()) { - nsCOMPtr widget = GetWidget(); - if (widget) { - bool isRetainingManager; - LayerManager* manager = widget->GetLayerManager(&isRetainingManager); - if (isRetainingManager) { - manager->BeginTransaction(); - nsLayoutUtils::PaintFrame(nsnull, rootFrame, nsRegion(), NS_RGB(255, 255, 255), - nsLayoutUtils::PAINT_WIDGET_LAYERS | - nsLayoutUtils::PAINT_EXISTING_TRANSACTION); - } + // Send empty paint transaction in order to release retained layers + if (displayport.IsEmpty()) { + nsCOMPtr widget = GetWidget(); + if (widget) { + bool isRetainingManager; + LayerManager* manager = widget->GetLayerManager(&isRetainingManager); + if (isRetainingManager) { + manager->BeginTransaction(); + nsLayoutUtils::PaintFrame(nsnull, rootFrame, nsRegion(), NS_RGB(255, 255, 255), + nsLayoutUtils::PAINT_WIDGET_LAYERS | + nsLayoutUtils::PAINT_EXISTING_TRANSACTION); } } } } return NS_OK; }