Commit 5cd2b5b1 authored by Jonathan Watt's avatar Jonathan Watt
Browse files

Bug 1557104. Merge nsIPageSequenceFrame and nsSimplePageSequenceFrame. r=dholbert

Differential Revision: https://phabricator.services.mozilla.com/D33817

--HG--
rename : layout/generic/nsSimplePageSequenceFrame.cpp => layout/generic/nsPageSequenceFrame.cpp
rename : layout/generic/nsSimplePageSequenceFrame.h => layout/generic/nsPageSequenceFrame.h
extra : rebase_source : e75b043af4dbfe4c108f2bfc0e234fd20c5af315
parent 50752727
Loading
Loading
Loading
Loading
+3 −4
Original line number Diff line number Diff line
@@ -67,7 +67,7 @@
#include "nsWindowSizes.h"
#include "nsCOMPtr.h"
#include "nsReadableUtils.h"
#include "nsIPageSequenceFrame.h"
#include "nsPageSequenceFrame.h"
#include "nsIPermissionManager.h"
#include "nsIMozBrowserFrame.h"
#include "nsCaret.h"
@@ -2440,9 +2440,8 @@ nsIScrollableFrame* PresShell::GetRootScrollFrameAsScrollable() const {
  return scrollableFrame;
}

nsIPageSequenceFrame* PresShell::GetPageSequenceFrame() const {
  nsIFrame* frame = mFrameConstructor->GetPageSequenceFrame();
  return do_QueryFrame(frame);
nsPageSequenceFrame* PresShell::GetPageSequenceFrame() const {
  return mFrameConstructor->GetPageSequenceFrame();
}

nsCanvasFrame* PresShell::GetCanvasFrame() const {
+2 −2
Original line number Diff line number Diff line
@@ -80,7 +80,7 @@ class nsIDocShell;
class nsIFrame;
class nsILayoutHistoryState;
class nsINode;
class nsIPageSequenceFrame;
class nsPageSequenceFrame;
class nsIReflowCallback;
class nsIScrollableFrame;
class nsITimer;
@@ -453,7 +453,7 @@ class PresShell final : public nsStubDocumentObserver,
   * Returns the page sequence frame associated with the frame hierarchy.
   * Returns nullptr if not a paginated view.
   */
  nsIPageSequenceFrame* GetPageSequenceFrame() const;
  nsPageSequenceFrame* GetPageSequenceFrame() const;

  /**
   * Returns the canvas frame associated with the frame hierarchy.
+6 −6
Original line number Diff line number Diff line
@@ -99,7 +99,7 @@
#include "nsFirstLetterFrame.h"
#include "nsGfxScrollFrame.h"
#include "nsPageFrame.h"
#include "nsSimplePageSequenceFrame.h"
#include "nsPageSequenceFrame.h"
#include "nsTableWrapperFrame.h"
#include "nsIScrollableFrame.h"
#include "nsBackdropFrame.h"
@@ -2517,7 +2517,7 @@ void nsCSSFrameConstructor::SetUpDocElementContainingBlock(
  Print presentation, non-XUL

      ViewportFrame
        nsSimplePageSequenceFrame
        nsPageSequenceFrame
          nsPageFrame
            nsPageContentFrame [fixed-cb]
              nsCanvasFrame [abs-cb]
@@ -2528,7 +2528,7 @@ void nsCSSFrameConstructor::SetUpDocElementContainingBlock(

      ViewportFrame
        nsHTMLScrollFrame
          nsSimplePageSequenceFrame
          nsPageSequenceFrame
            nsPageFrame
              nsPageContentFrame [fixed-cb]
                nsCanvasFrame [abs-cb]
@@ -2544,7 +2544,7 @@ void nsCSSFrameConstructor::SetUpDocElementContainingBlock(
      the root element.
    mDocElementContainingBlock is the parent of mRootElementFrame
      (i.e. nsCanvasFrame or nsRootBoxFrame)
    mPageSequenceFrame is the nsSimplePageSequenceFrame, or null if there isn't
    mPageSequenceFrame is the nsPageSequenceFrame, or null if there isn't
      one
  */

@@ -2584,8 +2584,8 @@ void nsCSSFrameConstructor::SetUpDocElementContainingBlock(
    mDocElementContainingBlock = rootFrame;
  } else {
    // Create a page sequence frame
    rootFrame = NS_NewSimplePageSequenceFrame(mPresShell, viewportPseudoStyle);
    mPageSequenceFrame = rootFrame;
    rootFrame = mPageSequenceFrame =
        NS_NewPageSequenceFrame(mPresShell, viewportPseudoStyle);
    rootPseudo = PseudoStyleType::pageSequence;
    rootFrame->AddStateBits(NS_FRAME_OWNS_ANON_BOXES);
  }
+3 −2
Original line number Diff line number Diff line
@@ -34,6 +34,7 @@ class nsContainerFrame;
class nsFirstLineFrame;
class nsFirstLetterFrame;
class nsCSSAnonBoxPseudoStaticAtom;
class nsPageSequenceFrame;

class nsPageContentFrame;
struct PendingBinding;
@@ -342,7 +343,7 @@ class nsCSSFrameConstructor final : public nsFrameManager {
  // This returns the frame for the root element that does not
  // have a psuedo-element style
  nsIFrame* GetRootElementStyleFrame() { return mRootElementStyleFrame; }
  nsIFrame* GetPageSequenceFrame() { return mPageSequenceFrame; }
  nsPageSequenceFrame* GetPageSequenceFrame() { return mPageSequenceFrame; }

  // Get the frame that is the parent of the root element.
  nsContainerFrame* GetDocElementContainingBlock() {
@@ -2125,7 +2126,7 @@ class nsCSSFrameConstructor final : public nsFrameManager {
  // This is the containing block that contains the root element ---
  // the real "initial containing block" according to CSS 2.1.
  nsContainerFrame* mDocElementContainingBlock;
  nsIFrame* mPageSequenceFrame;
  nsPageSequenceFrame* mPageSequenceFrame;

  // FrameConstructionItem arena + list of freed items available for re-use.
  mozilla::ArenaAllocator<4096, 8> mFCItemPool;
+2 −3
Original line number Diff line number Diff line
@@ -49,7 +49,7 @@
#include "nsViewManager.h"
#include "nsView.h"

#include "nsIPageSequenceFrame.h"
#include "nsPageSequenceFrame.h"
#include "nsNetUtil.h"
#include "nsIContentViewerEdit.h"
#include "mozilla/css/Loader.h"
@@ -2796,7 +2796,7 @@ nsDocumentViewer::SetFullZoom(float aFullZoom) {

    mPrintPreviewZoom = aFullZoom;
    pc->SetPrintPreviewScale(aFullZoom * mOriginalPrintPreviewScale);
    nsIPageSequenceFrame* pf = presShell->GetPageSequenceFrame();
    nsPageSequenceFrame* pf = presShell->GetPageSequenceFrame();
    if (pf) {
      nsIFrame* f = do_QueryFrame(pf);
      presShell->FrameNeedsReflow(f, IntrinsicDirty::Resize, NS_FRAME_IS_DIRTY);
@@ -3644,7 +3644,6 @@ nsDocumentViewer::PrintPreviewNavigate(int16_t aType, int32_t aPageNum) {
    return NS_OK;
  }

  // Finds the SimplePageSequencer frame
  // in PP mPrtPreview->mPrintObject->mSeqFrame is null
  nsIFrame* seqFrame = nullptr;
  int32_t pageCount = 0;
Loading