Rename CXFA_ContainerLayoutItem to CXFA_ViewLayoutItem.

Because the names Content/Container are confusingly similar. The
only sub-class is a CFXA_FFPageView, so the name "view" was chosen.

It is doubly confusing because CFXA_Nodes also have a container
property (as in can contain other nodes) that has no relation to
the layout item containers. That property remains named "container".

It is triply confusing because there is an XFA_Element::ContentArea
node that corresponded to a plain ContainerLayoutItem, not a
ContentLayoutItem.

No functional change. No manual edits.

Change-Id: Ic123599aa10c8656d878e446314e84e9e9a89545
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/52930
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
diff --git a/fxjs/xfa/cjx_layoutpseudomodel.cpp b/fxjs/xfa/cjx_layoutpseudomodel.cpp
index 1bf9e6a..48e4a8f 100644
--- a/fxjs/xfa/cjx_layoutpseudomodel.cpp
+++ b/fxjs/xfa/cjx_layoutpseudomodel.cpp
@@ -17,11 +17,11 @@
 #include "third_party/base/ptr_util.h"
 #include "third_party/base/stl_util.h"
 #include "xfa/fxfa/cxfa_ffnotify.h"
-#include "xfa/fxfa/layout/cxfa_containerlayoutitem.h"
 #include "xfa/fxfa/layout/cxfa_contentlayoutitem.h"
 #include "xfa/fxfa/layout/cxfa_layoutitem.h"
 #include "xfa/fxfa/layout/cxfa_layoutprocessor.h"
 #include "xfa/fxfa/layout/cxfa_traversestrategy_layoutitem.h"
+#include "xfa/fxfa/layout/cxfa_viewlayoutitem.h"
 #include "xfa/fxfa/parser/cscript_layoutpseudomodel.h"
 #include "xfa/fxfa/parser/cxfa_arraynodelist.h"
 #include "xfa/fxfa/parser/cxfa_document.h"
@@ -167,7 +167,7 @@
   int32_t iPageNum = pDocLayout->CountPages();
   if (bNumbered) {
     for (int32_t i = 0; i < iPageNum; i++) {
-      CXFA_ContainerLayoutItem* pLayoutPage = pDocLayout->GetPage(i);
+      CXFA_ViewLayoutItem* pLayoutPage = pDocLayout->GetPage(i);
       if (!pLayoutPage)
         continue;
 
@@ -221,7 +221,7 @@
     int32_t iPageNo,
     const WideString& wsType,
     bool bOnPageArea) {
-  CXFA_ContainerLayoutItem* pLayoutPage = pDocLayout->GetPage(iPageNo);
+  CXFA_ViewLayoutItem* pLayoutPage = pDocLayout->GetPage(iPageNo);
   if (!pLayoutPage)
     return std::vector<CXFA_Node*>();
 
diff --git a/xfa/fxfa/cxfa_ffdocview.cpp b/xfa/fxfa/cxfa_ffdocview.cpp
index 9160398..ca36cbd 100644
--- a/xfa/fxfa/cxfa_ffdocview.cpp
+++ b/xfa/fxfa/cxfa_ffdocview.cpp
@@ -431,7 +431,7 @@
   return nullptr;
 }
 
-void CXFA_FFDocView::OnPageEvent(CXFA_ContainerLayoutItem* pSender,
+void CXFA_FFDocView::OnPageEvent(CXFA_ViewLayoutItem* pSender,
                                  uint32_t dwEvent) {
   CXFA_FFPageView* pFFPageView = static_cast<CXFA_FFPageView*>(pSender);
   m_pDoc->GetDocEnvironment()->PageViewEvent(pFFPageView, dwEvent);
diff --git a/xfa/fxfa/cxfa_ffdocview.h b/xfa/fxfa/cxfa_ffdocview.h
index 1c7ab80..b2debf3 100644
--- a/xfa/fxfa/cxfa_ffdocview.h
+++ b/xfa/fxfa/cxfa_ffdocview.h
@@ -16,13 +16,13 @@
 #include "xfa/fxfa/cxfa_ffdoc.h"
 
 class CXFA_BindItems;
-class CXFA_ContainerLayoutItem;
-class CXFA_FFWidgetHandler;
 class CXFA_FFDoc;
 class CXFA_FFWidget;
+class CXFA_FFWidgetHandler;
 class CXFA_Node;
-class CXFA_Subform;
 class CXFA_ReadyNodeIterator;
+class CXFA_Subform;
+class CXFA_ViewLayoutItem;
 
 extern const XFA_AttributeValue gs_EventActivity[];
 enum XFA_DOCVIEW_LAYOUTSTATUS {
@@ -65,7 +65,7 @@
   CXFA_FFWidget* GetWidgetByName(const WideString& wsName,
                                  CXFA_FFWidget* pRefWidget);
   CXFA_LayoutProcessor* GetXFALayout() const;
-  void OnPageEvent(CXFA_ContainerLayoutItem* pSender, uint32_t dwEvent);
+  void OnPageEvent(CXFA_ViewLayoutItem* pSender, uint32_t dwEvent);
   void LockUpdate() { m_iLock++; }
   void UnlockUpdate() { m_iLock--; }
   void InvalidateRect(CXFA_FFPageView* pPageView,
diff --git a/xfa/fxfa/cxfa_ffnotify.cpp b/xfa/fxfa/cxfa_ffnotify.cpp
index 4a99ded..be551d2 100644
--- a/xfa/fxfa/cxfa_ffnotify.cpp
+++ b/xfa/fxfa/cxfa_ffnotify.cpp
@@ -59,7 +59,7 @@
 
 CXFA_FFNotify::~CXFA_FFNotify() {}
 
-void CXFA_FFNotify::OnPageEvent(CXFA_ContainerLayoutItem* pSender,
+void CXFA_FFNotify::OnPageEvent(CXFA_ViewLayoutItem* pSender,
                                 uint32_t dwEvent) {
   CXFA_FFDocView* pDocView = m_pDoc->GetDocView(pSender->GetLayout());
   if (pDocView)
@@ -92,8 +92,8 @@
   }
 }
 
-std::unique_ptr<CXFA_ContainerLayoutItem>
-CXFA_FFNotify::OnCreateContainerLayoutItem(CXFA_Node* pNode) {
+std::unique_ptr<CXFA_ViewLayoutItem> CXFA_FFNotify::OnCreateViewLayoutItem(
+    CXFA_Node* pNode) {
   XFA_Element type = pNode->GetElementType();
   if (type == XFA_Element::PageArea) {
     CXFA_LayoutProcessor* pLayout = m_pDoc->GetXFADoc()->GetLayoutProcessor();
@@ -101,7 +101,7 @@
                                                pNode);
   }
   if (type == XFA_Element::ContentArea)
-    return pdfium::MakeUnique<CXFA_ContainerLayoutItem>(pNode);
+    return pdfium::MakeUnique<CXFA_ViewLayoutItem>(pNode);
 
   NOTREACHED();
   return nullptr;
diff --git a/xfa/fxfa/cxfa_ffnotify.h b/xfa/fxfa/cxfa_ffnotify.h
index 8d3b0bd..34b850b 100644
--- a/xfa/fxfa/cxfa_ffnotify.h
+++ b/xfa/fxfa/cxfa_ffnotify.h
@@ -12,18 +12,18 @@
 #include "xfa/fxfa/cxfa_eventparam.h"
 #include "xfa/fxfa/parser/cxfa_document.h"
 
-class CXFA_FFWidgetHandler;
-class CXFA_ContainerLayoutItem;
 class CXFA_ContentLayoutItem;
+class CXFA_FFWidgetHandler;
 class CXFA_LayoutItem;
 class CXFA_Script;
+class CXFA_ViewLayoutItem;
 
 class CXFA_FFNotify {
  public:
   explicit CXFA_FFNotify(CXFA_FFDoc* pDoc);
   ~CXFA_FFNotify();
 
-  void OnPageEvent(CXFA_ContainerLayoutItem* pSender, uint32_t dwEvent);
+  void OnPageEvent(CXFA_ViewLayoutItem* pSender, uint32_t dwEvent);
 
   void OnWidgetListItemAdded(CXFA_Node* pSender,
                              const wchar_t* pLabel,
@@ -42,8 +42,7 @@
   void OnChildAdded(CXFA_Node* pSender);
   void OnChildRemoved();
 
-  std::unique_ptr<CXFA_ContainerLayoutItem> OnCreateContainerLayoutItem(
-      CXFA_Node* pNode);
+  std::unique_ptr<CXFA_ViewLayoutItem> OnCreateViewLayoutItem(CXFA_Node* pNode);
   std::unique_ptr<CXFA_ContentLayoutItem> OnCreateContentLayoutItem(
       CXFA_Node* pNode);
 
diff --git a/xfa/fxfa/cxfa_ffpageview.cpp b/xfa/fxfa/cxfa_ffpageview.cpp
index 727ee00..29b4f5c 100644
--- a/xfa/fxfa/cxfa_ffpageview.cpp
+++ b/xfa/fxfa/cxfa_ffpageview.cpp
@@ -111,7 +111,7 @@
 }  // namespace
 
 CXFA_FFPageView::CXFA_FFPageView(CXFA_FFDocView* pDocView, CXFA_Node* pPageArea)
-    : CXFA_ContainerLayoutItem(pPageArea), m_pDocView(pDocView) {}
+    : CXFA_ViewLayoutItem(pPageArea), m_pDocView(pDocView) {}
 
 CXFA_FFPageView::~CXFA_FFPageView() {}
 
@@ -380,7 +380,7 @@
 
 void CXFA_FFTabOrderPageWidgetIterator::OrderContainer(
     CXFA_LayoutItemIterator* sIterator,
-    CXFA_LayoutItem* pContainerItem,
+    CXFA_LayoutItem* pViewItem,
     CXFA_TabParam* pContainer,
     bool* bCurrentItem,
     bool* bContentArea,
@@ -402,7 +402,7 @@
         pSearchItem = sIterator->MoveToNext();
         continue;
       }
-      if (pContainerItem && (pSearchItem->GetParent() != pContainerItem)) {
+      if (pViewItem && (pSearchItem->GetParent() != pViewItem)) {
         *bCurrentItem = true;
         break;
       }
diff --git a/xfa/fxfa/cxfa_ffpageview.h b/xfa/fxfa/cxfa_ffpageview.h
index 8b143ad..f6fda19 100644
--- a/xfa/fxfa/cxfa_ffpageview.h
+++ b/xfa/fxfa/cxfa_ffpageview.h
@@ -10,14 +10,14 @@
 #include <memory>
 #include <vector>
 
-#include "xfa/fxfa/layout/cxfa_containerlayoutitem.h"
 #include "xfa/fxfa/layout/cxfa_contentlayoutitem.h"
 #include "xfa/fxfa/layout/cxfa_traversestrategy_layoutitem.h"
+#include "xfa/fxfa/layout/cxfa_viewlayoutitem.h"
 
 class CXFA_FFWidget;
 class CXFA_FFDocView;
 
-class CXFA_FFPageView final : public CXFA_ContainerLayoutItem {
+class CXFA_FFPageView final : public CXFA_ViewLayoutItem {
  public:
   CXFA_FFPageView(CXFA_FFDocView* pDocView, CXFA_Node* pPageArea);
   ~CXFA_FFPageView() override;
@@ -93,7 +93,7 @@
   void CreateSpaceOrderWidgetArray(std::vector<CXFA_FFWidget*>* WidgetArray);
   CXFA_FFWidget* GetWidget(CXFA_LayoutItem* pLayoutItem);
   void OrderContainer(CXFA_LayoutItemIterator* sIterator,
-                      CXFA_LayoutItem* pContainerItem,
+                      CXFA_LayoutItem* pViewItem,
                       CXFA_TabParam* pContainer,
                       bool* bCurrentItem,
                       bool* bContentArea,
diff --git a/xfa/fxfa/layout/BUILD.gn b/xfa/fxfa/layout/BUILD.gn
index b69413d..a0b61e6 100644
--- a/xfa/fxfa/layout/BUILD.gn
+++ b/xfa/fxfa/layout/BUILD.gn
@@ -10,8 +10,6 @@
 
 jumbo_source_set("layout") {
   sources = [
-    "cxfa_containerlayoutitem.cpp",
-    "cxfa_containerlayoutitem.h",
     "cxfa_contentlayoutitem.cpp",
     "cxfa_contentlayoutitem.h",
     "cxfa_itemlayoutprocessor.cpp",
@@ -24,8 +22,10 @@
     "cxfa_layoutpagemgr.h",
     "cxfa_layoutprocessor.cpp",
     "cxfa_layoutprocessor.h",
-    "cxfa_traversestrategy_contentareacontainerlayoutitem.h",
     "cxfa_traversestrategy_layoutitem.h",
+    "cxfa_traversestrategy_viewlayoutitem.h",
+    "cxfa_viewlayoutitem.cpp",
+    "cxfa_viewlayoutitem.h",
   ]
   deps = [
     "../../../core/fxcrt",
diff --git a/xfa/fxfa/layout/cxfa_itemlayoutprocessor.cpp b/xfa/fxfa/layout/cxfa_itemlayoutprocessor.cpp
index ddae0cc..cd13915 100644
--- a/xfa/fxfa/layout/cxfa_itemlayoutprocessor.cpp
+++ b/xfa/fxfa/layout/cxfa_itemlayoutprocessor.cpp
@@ -18,10 +18,10 @@
 #include "third_party/base/stl_util.h"
 #include "xfa/fxfa/cxfa_ffdoc.h"
 #include "xfa/fxfa/cxfa_ffnotify.h"
-#include "xfa/fxfa/layout/cxfa_containerlayoutitem.h"
 #include "xfa/fxfa/layout/cxfa_contentlayoutitem.h"
 #include "xfa/fxfa/layout/cxfa_layoutcontext.h"
 #include "xfa/fxfa/layout/cxfa_layoutpagemgr.h"
+#include "xfa/fxfa/layout/cxfa_viewlayoutitem.h"
 #include "xfa/fxfa/parser/cxfa_document.h"
 #include "xfa/fxfa/parser/cxfa_keep.h"
 #include "xfa/fxfa/parser/cxfa_localemgr.h"
@@ -964,7 +964,7 @@
 }
 
 void CXFA_ItemLayoutProcessor::DoLayoutPageArea(
-    CXFA_ContainerLayoutItem* pPageAreaLayoutItem) {
+    CXFA_ViewLayoutItem* pPageAreaLayoutItem) {
   CXFA_Node* pFormNode = pPageAreaLayoutItem->GetFormNode();
   CXFA_Node* pCurChildNode = nullptr;
   CXFA_LayoutItem* pBeforeItem = nullptr;
diff --git a/xfa/fxfa/layout/cxfa_itemlayoutprocessor.h b/xfa/fxfa/layout/cxfa_itemlayoutprocessor.h
index 6fdf25b..3faffb2 100644
--- a/xfa/fxfa/layout/cxfa_itemlayoutprocessor.h
+++ b/xfa/fxfa/layout/cxfa_itemlayoutprocessor.h
@@ -21,13 +21,13 @@
 
 constexpr float kXFALayoutPrecision = 0.0005f;
 
-class CXFA_ContainerLayoutItem;
 class CXFA_ContentLayoutItem;
 class CXFA_ItemLayoutProcessor;
 class CXFA_LayoutContext;
 class CXFA_LayoutPageMgr;
 class CXFA_LayoutProcessor;
 class CXFA_Node;
+class CXFA_ViewLayoutItem;
 
 class CXFA_ItemLayoutProcessor {
  public:
@@ -56,7 +56,7 @@
                   float fHeightLimit,
                   float fRealHeight,
                   CXFA_LayoutContext* pContext);
-  void DoLayoutPageArea(CXFA_ContainerLayoutItem* pPageAreaLayoutItem);
+  void DoLayoutPageArea(CXFA_ViewLayoutItem* pPageAreaLayoutItem);
 
   CXFA_Node* GetFormNode() { return m_pFormNode; }
   CXFA_ContentLayoutItem* ExtractLayoutItem();
diff --git a/xfa/fxfa/layout/cxfa_layoutitem.cpp b/xfa/fxfa/layout/cxfa_layoutitem.cpp
index 8711e1a..3dc65ce 100644
--- a/xfa/fxfa/layout/cxfa_layoutitem.cpp
+++ b/xfa/fxfa/layout/cxfa_layoutitem.cpp
@@ -8,8 +8,8 @@
 
 #include "fxjs/xfa/cjx_object.h"
 #include "xfa/fxfa/cxfa_ffnotify.h"
-#include "xfa/fxfa/layout/cxfa_containerlayoutitem.h"
 #include "xfa/fxfa/layout/cxfa_contentlayoutitem.h"
+#include "xfa/fxfa/layout/cxfa_viewlayoutitem.h"
 #include "xfa/fxfa/parser/cxfa_margin.h"
 #include "xfa/fxfa/parser/cxfa_measurement.h"
 #include "xfa/fxfa/parser/cxfa_node.h"
@@ -28,7 +28,7 @@
   }
   pNotify->OnLayoutItemRemoving(pDocLayout, pLayoutItem);
   if (pLayoutItem->GetFormNode()->GetElementType() == XFA_Element::PageArea) {
-    pNotify->OnPageEvent(ToContainerLayoutItem(pLayoutItem),
+    pNotify->OnPageEvent(ToViewLayoutItem(pLayoutItem),
                          XFA_PAGEVIEWEVENT_PostRemoved);
   }
   delete pLayoutItem;
@@ -39,15 +39,13 @@
 
 CXFA_LayoutItem::~CXFA_LayoutItem() = default;
 
-CXFA_ContainerLayoutItem* CXFA_LayoutItem::AsContainerLayoutItem() {
-  return IsContainerLayoutItem() ? static_cast<CXFA_ContainerLayoutItem*>(this)
-                                 : nullptr;
+CXFA_ViewLayoutItem* CXFA_LayoutItem::AsViewLayoutItem() {
+  return IsViewLayoutItem() ? static_cast<CXFA_ViewLayoutItem*>(this) : nullptr;
 }
 
-const CXFA_ContainerLayoutItem* CXFA_LayoutItem::AsContainerLayoutItem() const {
-  return IsContainerLayoutItem()
-             ? static_cast<const CXFA_ContainerLayoutItem*>(this)
-             : nullptr;
+const CXFA_ViewLayoutItem* CXFA_LayoutItem::AsViewLayoutItem() const {
+  return IsViewLayoutItem() ? static_cast<const CXFA_ViewLayoutItem*>(this)
+                            : nullptr;
 }
 
 CXFA_ContentLayoutItem* CXFA_LayoutItem::AsContentLayoutItem() {
@@ -61,11 +59,11 @@
              : nullptr;
 }
 
-CXFA_ContainerLayoutItem* CXFA_LayoutItem::GetPage() const {
+CXFA_ViewLayoutItem* CXFA_LayoutItem::GetPage() const {
   for (CXFA_LayoutItem* pCurNode = const_cast<CXFA_LayoutItem*>(this); pCurNode;
        pCurNode = pCurNode->m_pParent) {
     if (pCurNode->m_pFormNode->GetElementType() == XFA_Element::PageArea)
-      return pCurNode->AsContainerLayoutItem();
+      return pCurNode->AsViewLayoutItem();
   }
   return nullptr;
 }
diff --git a/xfa/fxfa/layout/cxfa_layoutitem.h b/xfa/fxfa/layout/cxfa_layoutitem.h
index 46b9b04..3dd6754 100644
--- a/xfa/fxfa/layout/cxfa_layoutitem.h
+++ b/xfa/fxfa/layout/cxfa_layoutitem.h
@@ -10,22 +10,22 @@
 #include "core/fxcrt/unowned_ptr.h"
 #include "xfa/fxfa/parser/cxfa_document.h"
 
-class CXFA_ContainerLayoutItem;
 class CXFA_ContentLayoutItem;
 class CXFA_LayoutProcessor;
+class CXFA_ViewLayoutItem;
 
 class CXFA_LayoutItem {
  public:
   virtual ~CXFA_LayoutItem();
 
-  bool IsContainerLayoutItem() const { return m_ItemType == kContainerItem; }
+  bool IsViewLayoutItem() const { return m_ItemType == kViewItem; }
   bool IsContentLayoutItem() const { return m_ItemType == kContentItem; }
-  CXFA_ContainerLayoutItem* AsContainerLayoutItem();
-  const CXFA_ContainerLayoutItem* AsContainerLayoutItem() const;
+  CXFA_ViewLayoutItem* AsViewLayoutItem();
+  const CXFA_ViewLayoutItem* AsViewLayoutItem() const;
   CXFA_ContentLayoutItem* AsContentLayoutItem();
   const CXFA_ContentLayoutItem* AsContentLayoutItem() const;
 
-  CXFA_ContainerLayoutItem* GetPage() const;
+  CXFA_ViewLayoutItem* GetPage() const;
   CXFA_LayoutItem* GetParent() const { return m_pParent; }
   CXFA_LayoutItem* GetFirstChild() const { return m_pFirstChild; }
   CXFA_LayoutItem* GetNextSibling() const { return m_pNextSibling; }
@@ -43,7 +43,7 @@
   void InsertChild(CXFA_LayoutItem* pBeforeItem, CXFA_LayoutItem* pChildItem);
 
  protected:
-  enum ItemType { kContainerItem, kContentItem };
+  enum ItemType { kViewItem, kContentItem };
   CXFA_LayoutItem(CXFA_Node* pNode, ItemType type);
 
  private:
@@ -54,8 +54,8 @@
   UnownedPtr<CXFA_Node> m_pFormNode;
 };
 
-inline CXFA_ContainerLayoutItem* ToContainerLayoutItem(CXFA_LayoutItem* item) {
-  return item ? item->AsContainerLayoutItem() : nullptr;
+inline CXFA_ViewLayoutItem* ToViewLayoutItem(CXFA_LayoutItem* item) {
+  return item ? item->AsViewLayoutItem() : nullptr;
 }
 
 inline CXFA_ContentLayoutItem* ToContentLayoutItem(CXFA_LayoutItem* item) {
diff --git a/xfa/fxfa/layout/cxfa_layoutpagemgr.cpp b/xfa/fxfa/layout/cxfa_layoutpagemgr.cpp
index 4aedf00..112538d 100644
--- a/xfa/fxfa/layout/cxfa_layoutpagemgr.cpp
+++ b/xfa/fxfa/layout/cxfa_layoutpagemgr.cpp
@@ -12,12 +12,12 @@
 #include "fxjs/xfa/cjx_object.h"
 #include "third_party/base/stl_util.h"
 #include "xfa/fxfa/cxfa_ffnotify.h"
-#include "xfa/fxfa/layout/cxfa_containerlayoutitem.h"
 #include "xfa/fxfa/layout/cxfa_contentlayoutitem.h"
 #include "xfa/fxfa/layout/cxfa_itemlayoutprocessor.h"
 #include "xfa/fxfa/layout/cxfa_layoutprocessor.h"
-#include "xfa/fxfa/layout/cxfa_traversestrategy_contentareacontainerlayoutitem.h"
 #include "xfa/fxfa/layout/cxfa_traversestrategy_layoutitem.h"
+#include "xfa/fxfa/layout/cxfa_traversestrategy_viewlayoutitem.h"
+#include "xfa/fxfa/layout/cxfa_viewlayoutitem.h"
 #include "xfa/fxfa/parser/cxfa_contentarea.h"
 #include "xfa/fxfa/parser/cxfa_document.h"
 #include "xfa/fxfa/parser/cxfa_localemgr.h"
@@ -38,15 +38,13 @@
 
 class TraverseStrategy_PageSet {
  public:
-  static CXFA_ContainerLayoutItem* GetFirstChild(
-      CXFA_ContainerLayoutItem* pLayoutItem) {
+  static CXFA_ViewLayoutItem* GetFirstChild(CXFA_ViewLayoutItem* pLayoutItem) {
     if (pLayoutItem->GetFormNode()->GetElementType() != XFA_Element::PageSet)
       return nullptr;
 
     for (CXFA_LayoutItem* pChildItem = pLayoutItem->GetFirstChild(); pChildItem;
          pChildItem = pChildItem->GetNextSibling()) {
-      CXFA_ContainerLayoutItem* pContainer =
-          pChildItem->AsContainerLayoutItem();
+      CXFA_ViewLayoutItem* pContainer = pChildItem->AsViewLayoutItem();
       if (pContainer &&
           pContainer->GetFormNode()->GetElementType() == XFA_Element::PageSet) {
         return pContainer;
@@ -55,12 +53,10 @@
     return nullptr;
   }
 
-  static CXFA_ContainerLayoutItem* GetNextSibling(
-      CXFA_ContainerLayoutItem* pLayoutItem) {
+  static CXFA_ViewLayoutItem* GetNextSibling(CXFA_ViewLayoutItem* pLayoutItem) {
     for (CXFA_LayoutItem* pChildItem = pLayoutItem->GetNextSibling();
          pChildItem; pChildItem = pChildItem->GetNextSibling()) {
-      CXFA_ContainerLayoutItem* pContainer =
-          pChildItem->AsContainerLayoutItem();
+      CXFA_ViewLayoutItem* pContainer = pChildItem->AsViewLayoutItem();
       if (pContainer &&
           pContainer->GetFormNode()->GetElementType() == XFA_Element::PageSet) {
         return pContainer;
@@ -69,14 +65,13 @@
     return nullptr;
   }
 
-  static CXFA_ContainerLayoutItem* GetParent(
-      CXFA_ContainerLayoutItem* pLayoutItem) {
-    return ToContainerLayoutItem(pLayoutItem->GetParent());
+  static CXFA_ViewLayoutItem* GetParent(CXFA_ViewLayoutItem* pLayoutItem) {
+    return ToViewLayoutItem(pLayoutItem->GetParent());
   }
 };
 
-using PageSetIterator = CXFA_NodeIteratorTemplate<CXFA_ContainerLayoutItem,
-                                                  TraverseStrategy_PageSet>;
+using PageSetIterator =
+    CXFA_NodeIteratorTemplate<CXFA_ViewLayoutItem, TraverseStrategy_PageSet>;
 
 uint32_t GetRelevant(CXFA_Node* pFormItem, uint32_t dwParentRelvant) {
   uint32_t dwRelevant = XFA_WidgetStatus_Viewable | XFA_WidgetStatus_Printable;
@@ -101,7 +96,7 @@
 
 void SyncContainer(CXFA_FFNotify* pNotify,
                    CXFA_LayoutProcessor* pDocLayout,
-                   CXFA_LayoutItem* pContainerItem,
+                   CXFA_LayoutItem* pViewItem,
                    uint32_t dwRelevant,
                    bool bVisible,
                    int32_t nPageIndex) {
@@ -110,20 +105,19 @@
   uint32_t dwRelevantContainer = 0;
   if (bVisible) {
     XFA_AttributeValue eAttributeValue =
-        pContainerItem->GetFormNode()
+        pViewItem->GetFormNode()
             ->JSObject()
             ->TryEnum(XFA_Attribute::Presence, true)
             .value_or(XFA_AttributeValue::Visible);
     if (eAttributeValue == XFA_AttributeValue::Visible)
       bVisibleItem = true;
 
-    dwRelevantContainer =
-        GetRelevant(pContainerItem->GetFormNode(), dwRelevant);
+    dwRelevantContainer = GetRelevant(pViewItem->GetFormNode(), dwRelevant);
     dwStatus =
         (bVisibleItem ? XFA_WidgetStatus_Visible : 0) | dwRelevantContainer;
   }
-  pNotify->OnLayoutItemAdded(pDocLayout, pContainerItem, nPageIndex, dwStatus);
-  for (CXFA_LayoutItem* pChild = pContainerItem->GetFirstChild(); pChild;
+  pNotify->OnLayoutItemAdded(pDocLayout, pViewItem, nPageIndex, dwStatus);
+  for (CXFA_LayoutItem* pChild = pViewItem->GetFirstChild(); pChild;
        pChild = pChild->GetNextSibling()) {
     if (pChild->IsContentLayoutItem()) {
       SyncContainer(pNotify, pDocLayout, pChild, dwRelevantContainer,
@@ -132,9 +126,9 @@
   }
 }
 
-void ReorderLayoutItemToTail(CXFA_ContainerLayoutItem* pLayoutItem) {
-  CXFA_ContainerLayoutItem* pParentLayoutItem =
-      ToContainerLayoutItem(pLayoutItem->GetParent());
+void ReorderLayoutItemToTail(CXFA_ViewLayoutItem* pLayoutItem) {
+  CXFA_ViewLayoutItem* pParentLayoutItem =
+      ToViewLayoutItem(pLayoutItem->GetParent());
   if (!pParentLayoutItem)
     return;
 
@@ -142,9 +136,9 @@
   pParentLayoutItem->AddChild(pLayoutItem);
 }
 
-void RemoveLayoutItem(CXFA_ContainerLayoutItem* pLayoutItem) {
-  CXFA_ContainerLayoutItem* pParentLayoutItem =
-      ToContainerLayoutItem(pLayoutItem->GetParent());
+void RemoveLayoutItem(CXFA_ViewLayoutItem* pLayoutItem) {
+  CXFA_ViewLayoutItem* pParentLayoutItem =
+      ToViewLayoutItem(pLayoutItem->GetParent());
   if (!pParentLayoutItem)
     return;
 
@@ -212,12 +206,12 @@
 }
 
 // Note: Returning nullptr is not the same as returning pdfium::nullopt.
-Optional<CXFA_ContainerLayoutItem*> CheckContentAreaNotUsed(
-    CXFA_ContainerLayoutItem* pPageAreaLayoutItem,
+Optional<CXFA_ViewLayoutItem*> CheckContentAreaNotUsed(
+    CXFA_ViewLayoutItem* pPageAreaLayoutItem,
     CXFA_Node* pContentArea) {
   for (CXFA_LayoutItem* pChild = pPageAreaLayoutItem->GetFirstChild(); pChild;
        pChild = pChild->GetNextSibling()) {
-    CXFA_ContainerLayoutItem* pLayoutItem = pChild->AsContainerLayoutItem();
+    CXFA_ViewLayoutItem* pLayoutItem = pChild->AsViewLayoutItem();
     if (pLayoutItem && pLayoutItem->GetFormNode() == pContentArea) {
       if (!pLayoutItem->GetFirstChild())
         return pLayoutItem;
@@ -273,7 +267,7 @@
 }
 
 std::pair<size_t, CXFA_LayoutItem*> GetPageAreaCountAndLastPageAreaFromPageSet(
-    CXFA_ContainerLayoutItem* pPageSetLayoutItem) {
+    CXFA_ViewLayoutItem* pPageSetLayoutItem) {
   size_t nCount = 0;
   CXFA_LayoutItem* pLast = nullptr;
   for (CXFA_LayoutItem* pPageAreaLayoutItem =
@@ -312,18 +306,18 @@
 
 }  // namespace
 
-class CXFA_ContainerRecord {
+class CXFA_ViewRecord {
  public:
-  CXFA_ContainerRecord(CXFA_ContainerLayoutItem* pPageSet = nullptr,
-                       CXFA_ContainerLayoutItem* pPageArea = nullptr,
-                       CXFA_ContainerLayoutItem* pContentArea = nullptr)
+  CXFA_ViewRecord(CXFA_ViewLayoutItem* pPageSet = nullptr,
+                  CXFA_ViewLayoutItem* pPageArea = nullptr,
+                  CXFA_ViewLayoutItem* pContentArea = nullptr)
       : pCurPageSet(pPageSet),
         pCurPageArea(pPageArea),
         pCurContentArea(pContentArea) {}
 
-  CXFA_ContainerLayoutItem* pCurPageSet;
-  CXFA_ContainerLayoutItem* pCurPageArea;
-  CXFA_ContainerLayoutItem* pCurContentArea;
+  CXFA_ViewLayoutItem* pCurPageSet;
+  CXFA_ViewLayoutItem* pCurPageArea;
+  CXFA_ViewLayoutItem* pCurContentArea;
 };
 
 CXFA_LayoutPageMgr::CXFA_LayoutPageMgr(CXFA_LayoutProcessor* pLayoutProcessor)
@@ -331,7 +325,7 @@
       m_pTemplatePageSetRoot(nullptr),
       m_pPageSetLayoutItemRoot(nullptr),
       m_pPageSetCurRoot(nullptr),
-      m_CurrentContainerRecordIter(m_ProposedContainerRecords.end()),
+      m_CurrentViewRecordIter(m_ProposedViewRecords.end()),
       m_pCurPageArea(nullptr),
       m_nAvailPages(0),
       m_nCurPageCount(0),
@@ -365,8 +359,7 @@
     m_pPageSetLayoutItemRoot->SetNextSibling(nullptr);
     m_pPageSetLayoutItemRoot->SetFormNode(m_pTemplatePageSetRoot);
   } else {
-    m_pPageSetLayoutItemRoot =
-        new CXFA_ContainerLayoutItem(m_pTemplatePageSetRoot);
+    m_pPageSetLayoutItemRoot = new CXFA_ViewLayoutItem(m_pTemplatePageSetRoot);
   }
   m_pPageSetCurRoot = m_pPageSetLayoutItemRoot;
   m_pTemplatePageSetRoot->JSObject()->SetLayoutItem(m_pPageSetLayoutItemRoot);
@@ -472,7 +465,7 @@
   if (pBreakBeforeNode) {
     BreakData ret = ExecuteBreakBeforeOrAfter(pBreakBeforeNode, true);
     if (ret.bCreatePage) {
-      m_CurrentContainerRecordIter = m_ProposedContainerRecords.begin();
+      m_CurrentViewRecordIter = m_ProposedViewRecords.begin();
       return true;
     }
   }
@@ -480,23 +473,22 @@
 }
 
 bool CXFA_LayoutPageMgr::AppendNewPage(bool bFirstTemPage) {
-  if (m_CurrentContainerRecordIter != GetTailPosition())
+  if (m_CurrentViewRecordIter != GetTailPosition())
     return true;
 
   CXFA_Node* pPageNode = GetNextAvailPageArea(nullptr, nullptr, false, false);
   if (!pPageNode)
     return false;
 
-  if (bFirstTemPage &&
-      m_CurrentContainerRecordIter == m_ProposedContainerRecords.end()) {
-    m_CurrentContainerRecordIter = m_ProposedContainerRecords.begin();
+  if (bFirstTemPage && m_CurrentViewRecordIter == m_ProposedViewRecords.end()) {
+    m_CurrentViewRecordIter = m_ProposedViewRecords.begin();
   }
   return !bFirstTemPage ||
-         m_CurrentContainerRecordIter != m_ProposedContainerRecords.end();
+         m_CurrentViewRecordIter != m_ProposedViewRecords.end();
 }
 
-void CXFA_LayoutPageMgr::RemoveLayoutRecord(CXFA_ContainerRecord* pNewRecord,
-                                            CXFA_ContainerRecord* pPrevRecord) {
+void CXFA_LayoutPageMgr::RemoveLayoutRecord(CXFA_ViewRecord* pNewRecord,
+                                            CXFA_ViewRecord* pPrevRecord) {
   if (!pNewRecord || !pPrevRecord)
     return;
   if (pNewRecord->pCurPageSet != pPrevRecord->pCurPageSet) {
@@ -514,8 +506,8 @@
 }
 
 void CXFA_LayoutPageMgr::ReorderPendingLayoutRecordToTail(
-    CXFA_ContainerRecord* pNewRecord,
-    CXFA_ContainerRecord* pPrevRecord) {
+    CXFA_ViewRecord* pNewRecord,
+    CXFA_ViewRecord* pPrevRecord) {
   if (!pNewRecord || !pPrevRecord)
     return;
   if (pNewRecord->pCurPageSet != pPrevRecord->pCurPageSet) {
@@ -536,23 +528,22 @@
     CXFA_ContentLayoutItem* pContentLayoutItem,
     CXFA_ItemLayoutProcessor::Result eStatus) {
   if (pContentLayoutItem) {
-    GetCurrentContainerRecord()->pCurContentArea->AddChild(pContentLayoutItem);
+    GetCurrentViewRecord()->pCurContentArea->AddChild(pContentLayoutItem);
     m_bCreateOverFlowPage = false;
   }
 
   if (eStatus != CXFA_ItemLayoutProcessor::Result::kDone) {
     if (eStatus == CXFA_ItemLayoutProcessor::Result::kPageFullBreak &&
-        m_CurrentContainerRecordIter == GetTailPosition()) {
+        m_CurrentViewRecordIter == GetTailPosition()) {
       AppendNewPage(false);
     }
-    m_CurrentContainerRecordIter = GetTailPosition();
-    m_pCurPageArea = GetCurrentContainerRecord()->pCurPageArea->GetFormNode();
+    m_CurrentViewRecordIter = GetTailPosition();
+    m_pCurPageArea = GetCurrentViewRecord()->pCurPageArea->GetFormNode();
   }
 }
 
 float CXFA_LayoutPageMgr::GetAvailHeight() {
-  CXFA_ContainerLayoutItem* pLayoutItem =
-      GetCurrentContainerRecord()->pCurContentArea;
+  CXFA_ViewLayoutItem* pLayoutItem = GetCurrentViewRecord()->pCurContentArea;
   if (!pLayoutItem || !pLayoutItem->GetFormNode())
     return 0.0f;
 
@@ -560,19 +551,18 @@
       XFA_Attribute::H, XFA_Unit::Pt);
   if (fAvailHeight >= kXFALayoutPrecision)
     return fAvailHeight;
-  if (m_CurrentContainerRecordIter == m_ProposedContainerRecords.begin())
+  if (m_CurrentViewRecordIter == m_ProposedViewRecords.begin())
     return 0.0f;
   return FLT_MAX;
 }
 
-CXFA_ContainerRecord* CXFA_LayoutPageMgr::CreateContainerRecord(
-    CXFA_Node* pPageNode,
-    bool bCreateNew) {
-  CXFA_ContainerRecord* pNewRecord = new CXFA_ContainerRecord();
-  if (m_CurrentContainerRecordIter != m_ProposedContainerRecords.end()) {
+CXFA_ViewRecord* CXFA_LayoutPageMgr::CreateViewRecord(CXFA_Node* pPageNode,
+                                                      bool bCreateNew) {
+  CXFA_ViewRecord* pNewRecord = new CXFA_ViewRecord();
+  if (m_CurrentViewRecordIter != m_ProposedViewRecords.end()) {
     if (!IsPageSetRootOrderedOccurrence() || !pPageNode) {
-      *pNewRecord = *GetCurrentContainerRecord();
-      m_ProposedContainerRecords.push_back(pNewRecord);
+      *pNewRecord = *GetCurrentViewRecord();
+      m_ProposedViewRecords.push_back(pNewRecord);
       return pNewRecord;
     }
     CXFA_Node* pPageSet = pPageNode->GetParent();
@@ -580,28 +570,28 @@
       if (pPageSet == m_pTemplatePageSetRoot) {
         pNewRecord->pCurPageSet = m_pPageSetCurRoot;
       } else {
-        CXFA_ContainerLayoutItem* pParentLayoutItem =
-            ToContainerLayoutItem(pPageSet->JSObject()->GetLayoutItem());
+        CXFA_ViewLayoutItem* pParentLayoutItem =
+            ToViewLayoutItem(pPageSet->JSObject()->GetLayoutItem());
         if (!pParentLayoutItem)
           pParentLayoutItem = m_pPageSetCurRoot;
 
         pNewRecord->pCurPageSet = pParentLayoutItem;
       }
     } else {
-      CXFA_ContainerLayoutItem* pParentPageSetLayout = nullptr;
-      if (pPageSet == GetCurrentContainerRecord()->pCurPageSet->GetFormNode()) {
-        pParentPageSetLayout = ToContainerLayoutItem(
-            GetCurrentContainerRecord()->pCurPageSet->GetParent());
+      CXFA_ViewLayoutItem* pParentPageSetLayout = nullptr;
+      if (pPageSet == GetCurrentViewRecord()->pCurPageSet->GetFormNode()) {
+        pParentPageSetLayout =
+            ToViewLayoutItem(GetCurrentViewRecord()->pCurPageSet->GetParent());
       } else {
-        pParentPageSetLayout = ToContainerLayoutItem(
+        pParentPageSetLayout = ToViewLayoutItem(
             pPageSet->GetParent()->JSObject()->GetLayoutItem());
       }
-      auto* pPageSetLayoutItem = new CXFA_ContainerLayoutItem(pPageSet);
+      auto* pPageSetLayoutItem = new CXFA_ViewLayoutItem(pPageSet);
       pPageSet->JSObject()->SetLayoutItem(pPageSetLayoutItem);
       if (!pParentPageSetLayout) {
-        CXFA_ContainerLayoutItem* pPrePageSet = m_pPageSetLayoutItemRoot;
+        CXFA_ViewLayoutItem* pPrePageSet = m_pPageSetLayoutItemRoot;
         while (pPrePageSet->GetNextSibling()) {
-          pPrePageSet = pPrePageSet->GetNextSibling()->AsContainerLayoutItem();
+          pPrePageSet = pPrePageSet->GetNextSibling()->AsViewLayoutItem();
         }
         pPrePageSet->SetNextSibling(pPageSetLayoutItem);
         m_pPageSetCurRoot = pPageSetLayoutItem;
@@ -616,8 +606,8 @@
       if (pPageSet == m_pTemplatePageSetRoot) {
         pNewRecord->pCurPageSet = m_pPageSetLayoutItemRoot;
       } else {
-        CXFA_ContainerLayoutItem* pPageSetLayoutItem =
-            new CXFA_ContainerLayoutItem(pPageSet);
+        CXFA_ViewLayoutItem* pPageSetLayoutItem =
+            new CXFA_ViewLayoutItem(pPageSet);
         pPageSet->JSObject()->SetLayoutItem(pPageSetLayoutItem);
         m_pPageSetLayoutItemRoot->AddChild(pPageSetLayoutItem);
         pNewRecord->pCurPageSet = pPageSetLayoutItem;
@@ -626,53 +616,50 @@
       pNewRecord->pCurPageSet = m_pPageSetLayoutItemRoot;
     }
   }
-  m_ProposedContainerRecords.push_back(pNewRecord);
+  m_ProposedViewRecords.push_back(pNewRecord);
   return pNewRecord;
 }
 
-void CXFA_LayoutPageMgr::AddPageAreaLayoutItem(CXFA_ContainerRecord* pNewRecord,
+void CXFA_LayoutPageMgr::AddPageAreaLayoutItem(CXFA_ViewRecord* pNewRecord,
                                                CXFA_Node* pNewPageArea) {
-  CXFA_ContainerLayoutItem* pNewPageAreaLayoutItem = nullptr;
+  CXFA_ViewLayoutItem* pNewPageAreaLayoutItem = nullptr;
   if (pdfium::IndexInBounds(m_PageArray, m_nAvailPages)) {
-    CXFA_ContainerLayoutItem* pContainerItem = m_PageArray[m_nAvailPages];
-    pContainerItem->SetFormNode(pNewPageArea);
+    CXFA_ViewLayoutItem* pViewItem = m_PageArray[m_nAvailPages];
+    pViewItem->SetFormNode(pNewPageArea);
     m_nAvailPages++;
-    pNewPageAreaLayoutItem = pContainerItem;
+    pNewPageAreaLayoutItem = pViewItem;
   } else {
     CXFA_FFNotify* pNotify = pNewPageArea->GetDocument()->GetNotify();
-    auto* pContainerItem =
-        pNotify->OnCreateContainerLayoutItem(pNewPageArea).release();
-    m_PageArray.push_back(pContainerItem);
+    auto* pViewItem = pNotify->OnCreateViewLayoutItem(pNewPageArea).release();
+    m_PageArray.push_back(pViewItem);
     m_nAvailPages++;
-    pNotify->OnPageEvent(pContainerItem, XFA_PAGEVIEWEVENT_PostRemoved);
-    pNewPageAreaLayoutItem = pContainerItem;
+    pNotify->OnPageEvent(pViewItem, XFA_PAGEVIEWEVENT_PostRemoved);
+    pNewPageAreaLayoutItem = pViewItem;
   }
   pNewRecord->pCurPageSet->AddChild(pNewPageAreaLayoutItem);
   pNewRecord->pCurPageArea = pNewPageAreaLayoutItem;
   pNewRecord->pCurContentArea = nullptr;
 }
 
-void CXFA_LayoutPageMgr::AddContentAreaLayoutItem(
-    CXFA_ContainerRecord* pNewRecord,
-    CXFA_Node* pContentArea) {
+void CXFA_LayoutPageMgr::AddContentAreaLayoutItem(CXFA_ViewRecord* pNewRecord,
+                                                  CXFA_Node* pContentArea) {
   if (!pContentArea) {
     pNewRecord->pCurContentArea = nullptr;
     return;
   }
-  CXFA_ContainerLayoutItem* pNewContentAreaLayoutItem =
-      new CXFA_ContainerLayoutItem(pContentArea);
+  CXFA_ViewLayoutItem* pNewContentAreaLayoutItem =
+      new CXFA_ViewLayoutItem(pContentArea);
   ASSERT(pNewRecord->pCurPageArea);
   pNewRecord->pCurPageArea->AddChild(pNewContentAreaLayoutItem);
   pNewRecord->pCurContentArea = pNewContentAreaLayoutItem;
 }
 
 void CXFA_LayoutPageMgr::FinishPaginatedPageSets() {
-  for (CXFA_ContainerLayoutItem* pRootPageSetLayoutItem =
-           m_pPageSetLayoutItemRoot;
-       pRootPageSetLayoutItem; pRootPageSetLayoutItem = ToContainerLayoutItem(
+  for (CXFA_ViewLayoutItem* pRootPageSetLayoutItem = m_pPageSetLayoutItemRoot;
+       pRootPageSetLayoutItem; pRootPageSetLayoutItem = ToViewLayoutItem(
                                    pRootPageSetLayoutItem->GetNextSibling())) {
     PageSetIterator sIterator(pRootPageSetLayoutItem);
-    for (CXFA_ContainerLayoutItem* pPageSetLayoutItem = sIterator.GetCurrent();
+    for (CXFA_ViewLayoutItem* pPageSetLayoutItem = sIterator.GetCurrent();
          pPageSetLayoutItem; pPageSetLayoutItem = sIterator.MoveToNext()) {
       XFA_AttributeValue ePageRelation =
           pPageSetLayoutItem->GetFormNode()->JSObject()->GetEnum(
@@ -696,14 +683,14 @@
   return pdfium::CollectionSize<int32_t>(m_PageArray);
 }
 
-CXFA_ContainerLayoutItem* CXFA_LayoutPageMgr::GetPage(int32_t index) const {
+CXFA_ViewLayoutItem* CXFA_LayoutPageMgr::GetPage(int32_t index) const {
   if (!pdfium::IndexInBounds(m_PageArray, index))
     return nullptr;
   return m_PageArray[index];
 }
 
 int32_t CXFA_LayoutPageMgr::GetPageIndex(
-    const CXFA_ContainerLayoutItem* pPage) const {
+    const CXFA_ViewLayoutItem* pPage) const {
   auto it = std::find(m_PageArray.begin(), m_PageArray.end(), pPage);
   return it != m_PageArray.end() ? it - m_PageArray.begin() : -1;
 }
@@ -717,10 +704,8 @@
     case XFA_AttributeValue::ContentArea:
       if (pTarget && pTarget->GetElementType() != XFA_Element::ContentArea)
         pTarget = nullptr;
-      if (!pTarget ||
-          m_CurrentContainerRecordIter == m_ProposedContainerRecords.end() ||
-          pTarget !=
-              GetCurrentContainerRecord()->pCurContentArea->GetFormNode() ||
+      if (!pTarget || m_CurrentViewRecordIter == m_ProposedViewRecords.end() ||
+          pTarget != GetCurrentViewRecord()->pCurContentArea->GetFormNode() ||
           bStartNew) {
         CXFA_Node* pPageArea = nullptr;
         if (pTarget)
@@ -733,9 +718,8 @@
     case XFA_AttributeValue::PageArea:
       if (pTarget && pTarget->GetElementType() != XFA_Element::PageArea)
         pTarget = nullptr;
-      if (!pTarget ||
-          m_CurrentContainerRecordIter == m_ProposedContainerRecords.end() ||
-          pTarget != GetCurrentContainerRecord()->pCurPageArea->GetFormNode() ||
+      if (!pTarget || m_CurrentViewRecordIter == m_ProposedViewRecords.end() ||
+          pTarget != GetCurrentViewRecord()->pCurPageArea->GetFormNode() ||
           bStartNew) {
         CXFA_Node* pPageArea =
             GetNextAvailPageArea(pTarget, nullptr, true, false);
@@ -790,8 +774,8 @@
         ret.bCreatePage = true;
         break;
       }
-      if (!m_ProposedContainerRecords.empty() &&
-          m_CurrentContainerRecordIter == m_ProposedContainerRecords.begin() &&
+      if (!m_ProposedViewRecords.empty() &&
+          m_CurrentViewRecordIter == m_ProposedViewRecords.begin() &&
           eType == XFA_Element::BreakBefore) {
         CXFA_Node* pParentNode = pFormNode->GetContainerParent();
         if (!pParentNode ||
@@ -1080,7 +1064,7 @@
                                            bNewPage, bQuery);
   }
   XFA_AttributeValue ePreferredPosition =
-      m_CurrentContainerRecordIter != m_ProposedContainerRecords.end()
+      m_CurrentViewRecordIter != m_ProposedViewRecords.end()
           ? XFA_AttributeValue::Rest
           : XFA_AttributeValue::First;
   return FindPageAreaFromPageSet_SimplexDuplex(
@@ -1128,8 +1112,8 @@
           continue;
         }
         if (!bQuery) {
-          CXFA_ContainerRecord* pNewRecord =
-              CreateContainerRecord(pCurrentNode, !pStartChild);
+          CXFA_ViewRecord* pNewRecord =
+              CreateViewRecord(pCurrentNode, !pStartChild);
           AddPageAreaLayoutItem(pNewRecord, pCurrentNode);
           if (!pTargetContentArea) {
             pTargetContentArea =
@@ -1194,8 +1178,7 @@
           pPreferredPageArea = pCurrentNode;
           break;
         }
-        CXFA_ContainerRecord* pNewRecord =
-            CreateContainerRecord(nullptr, false);
+        CXFA_ViewRecord* pNewRecord = CreateViewRecord(nullptr, false);
         AddPageAreaLayoutItem(pNewRecord, pCurrentNode);
         AddContentAreaLayoutItem(
             pNewRecord, pCurrentNode->GetFirstChildByClass<CXFA_ContentArea>(
@@ -1217,8 +1200,7 @@
         if (!pCurrentNode->GetFirstChildByClass<CXFA_ContentArea>(
                 XFA_Element::ContentArea)) {
           if (pTargetPageArea == pCurrentNode) {
-            CXFA_ContainerRecord* pNewRecord =
-                CreateContainerRecord(nullptr, false);
+            CXFA_ViewRecord* pNewRecord = CreateViewRecord(nullptr, false);
             AddPageAreaLayoutItem(pNewRecord, pCurrentNode);
             pTargetPageArea = nullptr;
           }
@@ -1234,8 +1216,7 @@
           pFallbackPageArea = pCurrentNode;
         }
       } else if (pTargetPageArea && !MatchPageAreaOddOrEven(pTargetPageArea)) {
-        CXFA_ContainerRecord* pNewRecord =
-            CreateContainerRecord(nullptr, false);
+        CXFA_ViewRecord* pNewRecord = CreateViewRecord(nullptr, false);
         AddPageAreaLayoutItem(pNewRecord, pCurrentNode);
         AddContentAreaLayoutItem(
             pNewRecord, pCurrentNode->GetFirstChildByClass<CXFA_ContentArea>(
@@ -1260,7 +1241,7 @@
     return false;
 
   if (!bQuery) {
-    CXFA_ContainerRecord* pNewRecord = CreateContainerRecord(nullptr, false);
+    CXFA_ViewRecord* pNewRecord = CreateViewRecord(nullptr, false);
     AddPageAreaLayoutItem(pNewRecord, pCurPageArea);
     if (!pTargetContentArea) {
       pTargetContentArea = pCurPageArea->GetFirstChildByClass<CXFA_ContentArea>(
@@ -1313,8 +1294,7 @@
       }
       if ((iMax < 0 || m_nCurPageCount < iMax)) {
         if (!bQuery) {
-          CXFA_ContainerRecord* pNewRecord =
-              CreateContainerRecord(m_pCurPageArea, false);
+          CXFA_ViewRecord* pNewRecord = CreateViewRecord(m_pCurPageArea, false);
           AddPageAreaLayoutItem(pNewRecord, m_pCurPageArea);
           if (!pTargetContentArea) {
             pTargetContentArea =
@@ -1359,7 +1339,7 @@
 
 bool CXFA_LayoutPageMgr::GetNextContentArea(CXFA_Node* pContentArea) {
   CXFA_Node* pCurContentNode =
-      GetCurrentContainerRecord()->pCurContentArea->GetFormNode();
+      GetCurrentViewRecord()->pCurContentArea->GetFormNode();
   if (!pContentArea) {
     pContentArea = pCurContentNode->GetNextSameClassSibling<CXFA_ContentArea>(
         XFA_Element::ContentArea);
@@ -1369,22 +1349,21 @@
     if (pContentArea->GetParent() != m_pCurPageArea)
       return false;
 
-    Optional<CXFA_ContainerLayoutItem*> pContentAreaLayout =
-        CheckContentAreaNotUsed(GetCurrentContainerRecord()->pCurPageArea,
-                                pContentArea);
+    Optional<CXFA_ViewLayoutItem*> pContentAreaLayout = CheckContentAreaNotUsed(
+        GetCurrentViewRecord()->pCurPageArea, pContentArea);
     if (!pContentAreaLayout.has_value())
       return false;
     if (pContentAreaLayout.value()) {
       if (pContentAreaLayout.value()->GetFormNode() == pCurContentNode)
         return false;
 
-      CXFA_ContainerRecord* pNewRecord = CreateContainerRecord(nullptr, false);
+      CXFA_ViewRecord* pNewRecord = CreateViewRecord(nullptr, false);
       pNewRecord->pCurContentArea = pContentAreaLayout.value();
       return true;
     }
   }
 
-  CXFA_ContainerRecord* pNewRecord = CreateContainerRecord(nullptr, false);
+  CXFA_ViewRecord* pNewRecord = CreateViewRecord(nullptr, false);
   AddContentAreaLayoutItem(pNewRecord, pContentArea);
   return true;
 }
@@ -1434,7 +1413,7 @@
     i = m_nCurPageCount;
 
   for (; i < iMin; i++) {
-    CXFA_ContainerRecord* pNewRecord = CreateContainerRecord(nullptr, false);
+    CXFA_ViewRecord* pNewRecord = CreateViewRecord(nullptr, false);
     AddPageAreaLayoutItem(pNewRecord, pPageArea);
     AddContentAreaLayoutItem(pNewRecord, pContentArea);
   }
@@ -1505,7 +1484,7 @@
 
 bool CXFA_LayoutPageMgr::GetNextAvailContentHeight(float fChildHeight) {
   CXFA_Node* pCurContentNode =
-      GetCurrentContainerRecord()->pCurContentArea->GetFormNode();
+      GetCurrentViewRecord()->pCurContentArea->GetFormNode();
   if (!pCurContentNode)
     return false;
 
@@ -1517,8 +1496,7 @@
     return fNextContentHeight > fChildHeight;
   }
 
-  CXFA_Node* pPageNode =
-      GetCurrentContainerRecord()->pCurPageArea->GetFormNode();
+  CXFA_Node* pPageNode = GetCurrentViewRecord()->pCurPageArea->GetFormNode();
   CXFA_Node* pOccurNode =
       pPageNode->GetFirstChildByClass<CXFA_Occur>(XFA_Element::Occur);
   int32_t iMax = 0;
@@ -1537,13 +1515,13 @@
           GetNextAvailPageArea(nullptr, nullptr, false, true);
       m_pCurPageArea = pSrcPage;
       m_nCurPageCount = nSrcPageCount;
-      CXFA_ContainerRecord* pPrevRecord = *psSrcIter++;
-      while (psSrcIter != m_ProposedContainerRecords.end()) {
+      CXFA_ViewRecord* pPrevRecord = *psSrcIter++;
+      while (psSrcIter != m_ProposedViewRecords.end()) {
         auto psSaveIter = psSrcIter;
-        CXFA_ContainerRecord* pInsertRecord = *psSrcIter++;
+        CXFA_ViewRecord* pInsertRecord = *psSrcIter++;
         RemoveLayoutRecord(pInsertRecord, pPrevRecord);
         delete pInsertRecord;
-        m_ProposedContainerRecords.erase(psSaveIter);
+        m_ProposedViewRecords.erase(psSaveIter);
       }
       if (pNextPage) {
         CXFA_Node* pContentArea =
@@ -1575,13 +1553,13 @@
   if (!m_pTemplatePageSetRoot)
     return;
 
-  auto sPos = m_ProposedContainerRecords.begin();
-  while (sPos != m_ProposedContainerRecords.end()) {
-    CXFA_ContainerRecord* pRecord = *sPos++;
+  auto sPos = m_ProposedViewRecords.begin();
+  while (sPos != m_ProposedViewRecords.end()) {
+    CXFA_ViewRecord* pRecord = *sPos++;
     delete pRecord;
   }
-  m_ProposedContainerRecords.clear();
-  m_CurrentContainerRecordIter = m_ProposedContainerRecords.end();
+  m_ProposedViewRecords.clear();
+  m_CurrentViewRecordIter = m_ProposedViewRecords.end();
   m_pCurPageArea = nullptr;
   m_nCurPageCount = 0;
   m_bCreateOverFlowPage = false;
@@ -1660,7 +1638,7 @@
   CXFA_Document* pDocument = m_pTemplatePageSetRoot->GetDocument();
   CXFA_FFNotify* pNotify = pDocument->GetNotify();
   CXFA_LayoutProcessor* pDocLayout = pDocument->GetLayoutProcessor();
-  CXFA_ContainerLayoutItem* pRootLayout = GetRootLayoutItem();
+  CXFA_ViewLayoutItem* pRootLayout = GetRootLayoutItem();
   for (CXFA_Node* pPageNode : pDocument->m_pPendingPageSet) {
     CXFA_NodeIteratorTemplate<CXFA_Node, CXFA_TraverseStrategy_XFANode>
         sIterator(pPageNode);
@@ -1679,14 +1657,13 @@
 
   int32_t iIndex = 0;
   for (; pRootLayout;
-       pRootLayout = ToContainerLayoutItem(pRootLayout->GetNextSibling())) {
+       pRootLayout = ToViewLayoutItem(pRootLayout->GetNextSibling())) {
     CXFA_Node* pPendingPageSet = nullptr;
-    CXFA_NodeIteratorTemplate<
-        CXFA_ContainerLayoutItem,
-        CXFA_TraverseStrategy_ContentAreaContainerLayoutItem>
+    CXFA_NodeIteratorTemplate<CXFA_ViewLayoutItem,
+                              CXFA_TraverseStrategy_ViewLayoutItem>
         iterator(pRootLayout);
-    CXFA_ContainerLayoutItem* pRootPageSetContainerItem = iterator.GetCurrent();
-    ASSERT(pRootPageSetContainerItem->GetFormNode()->GetElementType() ==
+    CXFA_ViewLayoutItem* pRootPageSetViewItem = iterator.GetCurrent();
+    ASSERT(pRootPageSetViewItem->GetFormNode()->GetElementType() ==
            XFA_Element::PageSet);
     if (iIndex <
         pdfium::CollectionSize<int32_t>(pDocument->m_pPendingPageSet)) {
@@ -1694,39 +1671,36 @@
       iIndex++;
     }
     if (!pPendingPageSet) {
-      if (pRootPageSetContainerItem->GetFormNode()->GetPacketType() ==
+      if (pRootPageSetViewItem->GetFormNode()->GetPacketType() ==
           XFA_PacketType::Template) {
         pPendingPageSet =
-            pRootPageSetContainerItem->GetFormNode()->CloneTemplateToForm(
-                false);
+            pRootPageSetViewItem->GetFormNode()->CloneTemplateToForm(false);
       } else {
-        pPendingPageSet = pRootPageSetContainerItem->GetFormNode();
+        pPendingPageSet = pRootPageSetViewItem->GetFormNode();
       }
     }
-    if (pRootPageSetContainerItem->GetFormNode()->JSObject()->GetLayoutItem() ==
-        pRootPageSetContainerItem) {
-      pRootPageSetContainerItem->GetFormNode()->JSObject()->SetLayoutItem(
-          nullptr);
+    if (pRootPageSetViewItem->GetFormNode()->JSObject()->GetLayoutItem() ==
+        pRootPageSetViewItem) {
+      pRootPageSetViewItem->GetFormNode()->JSObject()->SetLayoutItem(nullptr);
     }
-    pRootPageSetContainerItem->SetFormNode(pPendingPageSet);
+    pRootPageSetViewItem->SetFormNode(pPendingPageSet);
     pPendingPageSet->ClearFlag(XFA_NodeFlag_UnusedNode);
-    for (CXFA_ContainerLayoutItem* pContainerItem = iterator.MoveToNext();
-         pContainerItem; pContainerItem = iterator.MoveToNext()) {
-      CXFA_Node* pNode = pContainerItem->GetFormNode();
+    for (CXFA_ViewLayoutItem* pViewItem = iterator.MoveToNext(); pViewItem;
+         pViewItem = iterator.MoveToNext()) {
+      CXFA_Node* pNode = pViewItem->GetFormNode();
       if (pNode->GetPacketType() != XFA_PacketType::Template)
         continue;
 
       switch (pNode->GetElementType()) {
         case XFA_Element::PageSet: {
-          CXFA_Node* pParentNode = pContainerItem->GetParent()->GetFormNode();
-          pContainerItem->SetFormNode(XFA_NodeMerge_CloneOrMergeContainer(
-              pDocument, pParentNode, pContainerItem->GetFormNode(), true,
-              nullptr));
+          CXFA_Node* pParentNode = pViewItem->GetParent()->GetFormNode();
+          pViewItem->SetFormNode(XFA_NodeMerge_CloneOrMergeContainer(
+              pDocument, pParentNode, pViewItem->GetFormNode(), true, nullptr));
           break;
         }
         case XFA_Element::PageArea: {
-          CXFA_LayoutItem* pFormLayout = pContainerItem;
-          CXFA_Node* pParentNode = pContainerItem->GetParent()->GetFormNode();
+          CXFA_LayoutItem* pFormLayout = pViewItem;
+          CXFA_Node* pParentNode = pViewItem->GetParent()->GetFormNode();
           bool bIsExistForm = true;
           for (int32_t iLevel = 0; iLevel < 3; iLevel++) {
             pFormLayout = pFormLayout->GetFirstChild();
@@ -1743,11 +1717,11 @@
           }
           if (bIsExistForm) {
             CXFA_Node* pNewSubform = pFormLayout->GetFormNode();
-            if (pContainerItem->m_pOldSubform &&
-                pContainerItem->m_pOldSubform != pNewSubform) {
+            if (pViewItem->m_pOldSubform &&
+                pViewItem->m_pOldSubform != pNewSubform) {
               CXFA_Node* pExistingNode = XFA_DataMerge_FindFormDOMInstance(
-                  pDocument, pContainerItem->GetFormNode()->GetElementType(),
-                  pContainerItem->GetFormNode()->GetNameHash(), pParentNode);
+                  pDocument, pViewItem->GetFormNode()->GetElementType(),
+                  pViewItem->GetFormNode()->GetNameHash(), pParentNode);
               CXFA_ContainerIterator sIterator(pExistingNode);
               for (CXFA_Node* pIter = sIterator.GetCurrent(); pIter;
                    pIter = sIterator.MoveToNext()) {
@@ -1764,23 +1738,23 @@
                 pParentNode->RemoveChild(pExistingNode, true);
               }
             }
-            pContainerItem->m_pOldSubform = pNewSubform;
+            pViewItem->m_pOldSubform = pNewSubform;
           }
-          pContainerItem->SetFormNode(pDocument->DataMerge_CopyContainer(
-              pContainerItem->GetFormNode(), pParentNode,
+          pViewItem->SetFormNode(pDocument->DataMerge_CopyContainer(
+              pViewItem->GetFormNode(), pParentNode,
               ToNode(pDocument->GetXFAObject(XFA_HASHCODE_Record)), true, true,
               true));
           break;
         }
         case XFA_Element::ContentArea: {
-          CXFA_Node* pParentNode = pContainerItem->GetParent()->GetFormNode();
+          CXFA_Node* pParentNode = pViewItem->GetParent()->GetFormNode();
           for (CXFA_Node* pChildNode = pParentNode->GetFirstChild(); pChildNode;
                pChildNode = pChildNode->GetNextSibling()) {
             if (pChildNode->GetTemplateNodeIfExists() !=
-                pContainerItem->GetFormNode()) {
+                pViewItem->GetFormNode()) {
               continue;
             }
-            pContainerItem->SetFormNode(pChildNode);
+            pViewItem->SetFormNode(pChildNode);
             break;
           }
           break;
@@ -1849,21 +1823,20 @@
 }
 
 void CXFA_LayoutPageMgr::LayoutPageSetContents() {
-  for (CXFA_ContainerLayoutItem* pRootLayoutItem = GetRootLayoutItem();
-       pRootLayoutItem; pRootLayoutItem = ToContainerLayoutItem(
-                            pRootLayoutItem->GetNextSibling())) {
-    CXFA_NodeIteratorTemplate<
-        CXFA_ContainerLayoutItem,
-        CXFA_TraverseStrategy_ContentAreaContainerLayoutItem>
+  for (CXFA_ViewLayoutItem* pRootLayoutItem = GetRootLayoutItem();
+       pRootLayoutItem;
+       pRootLayoutItem = ToViewLayoutItem(pRootLayoutItem->GetNextSibling())) {
+    CXFA_NodeIteratorTemplate<CXFA_ViewLayoutItem,
+                              CXFA_TraverseStrategy_ViewLayoutItem>
         iterator(pRootLayoutItem);
-    for (CXFA_ContainerLayoutItem* pContainerItem = iterator.GetCurrent();
-         pContainerItem; pContainerItem = iterator.MoveToNext()) {
-      XFA_Element type = pContainerItem->GetFormNode()->GetElementType();
+    for (CXFA_ViewLayoutItem* pViewItem = iterator.GetCurrent(); pViewItem;
+         pViewItem = iterator.MoveToNext()) {
+      XFA_Element type = pViewItem->GetFormNode()->GetElementType();
       if (type != XFA_Element::PageArea)
         continue;
 
       m_pLayoutProcessor->GetRootRootItemLayoutProcessor()->DoLayoutPageArea(
-          pContainerItem);
+          pViewItem);
     }
   }
 }
@@ -1873,16 +1846,15 @@
   LayoutPageSetContents();
   CXFA_FFNotify* pNotify = m_pTemplatePageSetRoot->GetDocument()->GetNotify();
   int32_t nPageIdx = -1;
-  for (CXFA_ContainerLayoutItem* pRootLayoutItem = GetRootLayoutItem();
-       pRootLayoutItem; pRootLayoutItem = ToContainerLayoutItem(
-                            pRootLayoutItem->GetNextSibling())) {
-    CXFA_NodeIteratorTemplate<
-        CXFA_ContainerLayoutItem,
-        CXFA_TraverseStrategy_ContentAreaContainerLayoutItem>
+  for (CXFA_ViewLayoutItem* pRootLayoutItem = GetRootLayoutItem();
+       pRootLayoutItem;
+       pRootLayoutItem = ToViewLayoutItem(pRootLayoutItem->GetNextSibling())) {
+    CXFA_NodeIteratorTemplate<CXFA_ViewLayoutItem,
+                              CXFA_TraverseStrategy_ViewLayoutItem>
         iteratorParent(pRootLayoutItem);
-    for (CXFA_ContainerLayoutItem* pContainerItem = iteratorParent.GetCurrent();
-         pContainerItem; pContainerItem = iteratorParent.MoveToNext()) {
-      XFA_Element type = pContainerItem->GetFormNode()->GetElementType();
+    for (CXFA_ViewLayoutItem* pViewItem = iteratorParent.GetCurrent();
+         pViewItem; pViewItem = iteratorParent.MoveToNext()) {
+      XFA_Element type = pViewItem->GetFormNode()->GetElementType();
       if (type != XFA_Element::PageArea)
         continue;
 
@@ -1891,7 +1863,7 @@
           XFA_WidgetStatus_Viewable | XFA_WidgetStatus_Printable;
       CXFA_NodeIteratorTemplate<CXFA_LayoutItem,
                                 CXFA_TraverseStrategy_LayoutItem>
-          iterator(pContainerItem);
+          iterator(pViewItem);
       CXFA_LayoutItem* pChildLayoutItem = iterator.GetCurrent();
       while (pChildLayoutItem) {
         CXFA_ContentLayoutItem* pContentItem =
@@ -1918,7 +1890,7 @@
 
   int32_t nPage = pdfium::CollectionSize<int32_t>(m_PageArray);
   for (int32_t i = nPage - 1; i >= m_nAvailPages; i--) {
-    CXFA_ContainerLayoutItem* pPage = m_PageArray[i];
+    CXFA_ViewLayoutItem* pPage = m_PageArray[i];
     m_PageArray.erase(m_PageArray.begin() + i);
     pNotify->OnPageEvent(pPage, XFA_PAGEVIEWEVENT_PostRemoved);
     delete pPage;
@@ -1946,7 +1918,7 @@
   if (!m_pPageSetLayoutItemRoot)
     return;
 
-  CXFA_ContainerLayoutItem* pRootLayoutItem = m_pPageSetLayoutItemRoot;
+  CXFA_ViewLayoutItem* pRootLayoutItem = m_pPageSetLayoutItemRoot;
   if (pRootLayoutItem &&
       pRootLayoutItem->GetFormNode()->GetPacketType() == XFA_PacketType::Form) {
     CXFA_Node* pPageSetFormNode = pRootLayoutItem->GetFormNode();
@@ -1970,9 +1942,9 @@
     }
   }
   pRootLayoutItem = m_pPageSetLayoutItemRoot;
-  CXFA_ContainerLayoutItem* pNextLayout = nullptr;
+  CXFA_ViewLayoutItem* pNextLayout = nullptr;
   for (; pRootLayoutItem; pRootLayoutItem = pNextLayout) {
-    pNextLayout = ToContainerLayoutItem(pRootLayoutItem->GetNextSibling());
+    pNextLayout = ToViewLayoutItem(pRootLayoutItem->GetNextSibling());
     SaveLayoutItem(pRootLayoutItem);
     delete pRootLayoutItem;
   }
@@ -1980,7 +1952,7 @@
 }
 
 void CXFA_LayoutPageMgr::ProcessSimplexOrDuplexPageSets(
-    CXFA_ContainerLayoutItem* pPageSetLayoutItem,
+    CXFA_ViewLayoutItem* pPageSetLayoutItem,
     bool bIsSimplex) {
   size_t nPageAreaCount;
   CXFA_LayoutItem* pLastPageAreaLayoutItem;
@@ -2012,7 +1984,7 @@
             XFA_Attribute::PagePosition);
     if (eLastChoice == XFA_AttributeValue::First &&
         (bIsSimplex || eOddOrEven != XFA_AttributeValue::Odd)) {
-      CXFA_ContainerRecord* pRecord = CreateContainerRecord(nullptr, false);
+      CXFA_ViewRecord* pRecord = CreateViewRecord(nullptr, false);
       AddPageAreaLayoutItem(pRecord, pNode);
       return;
     }
@@ -2044,7 +2016,7 @@
 
   if (pNode->JSObject()->GetEnum(XFA_Attribute::PagePosition) ==
       XFA_AttributeValue::Last) {
-    CXFA_ContainerRecord* pRecord = CreateContainerRecord(nullptr, false);
+    CXFA_ViewRecord* pRecord = CreateViewRecord(nullptr, false);
     AddPageAreaLayoutItem(pRecord, pNode);
   }
 }
diff --git a/xfa/fxfa/layout/cxfa_layoutpagemgr.h b/xfa/fxfa/layout/cxfa_layoutpagemgr.h
index 59f7df9..0b6caf2 100644
--- a/xfa/fxfa/layout/cxfa_layoutpagemgr.h
+++ b/xfa/fxfa/layout/cxfa_layoutpagemgr.h
@@ -15,9 +15,9 @@
 #include "third_party/base/optional.h"
 #include "xfa/fxfa/layout/cxfa_itemlayoutprocessor.h"
 
-class CXFA_ContainerRecord;
 class CXFA_LayoutItem;
 class CXFA_Node;
+class CXFA_ViewRecord;
 
 class CXFA_LayoutPageMgr {
  public:
@@ -44,9 +44,9 @@
   void FinishPaginatedPageSets();
   void SyncLayoutData();
   int32_t GetPageCount() const;
-  CXFA_ContainerLayoutItem* GetPage(int32_t index) const;
-  int32_t GetPageIndex(const CXFA_ContainerLayoutItem* pPage) const;
-  inline CXFA_ContainerLayoutItem* GetRootLayoutItem() const {
+  CXFA_ViewLayoutItem* GetPage(int32_t index) const;
+  int32_t GetPageIndex(const CXFA_ViewLayoutItem* pPage) const;
+  inline CXFA_ViewLayoutItem* GetRootLayoutItem() const {
     return m_pPageSetLayoutItemRoot;
   }
   Optional<BreakData> ProcessBreakBefore(const CXFA_Node* pBreakNode);
@@ -59,22 +59,19 @@
 
  private:
   bool AppendNewPage(bool bFirstTemPage);
-  void ReorderPendingLayoutRecordToTail(CXFA_ContainerRecord* pNewRecord,
-                                        CXFA_ContainerRecord* pPrevRecord);
-  void RemoveLayoutRecord(CXFA_ContainerRecord* pNewRecord,
-                          CXFA_ContainerRecord* pPrevRecord);
-  CXFA_ContainerRecord* GetCurrentContainerRecord() {
-    return *m_CurrentContainerRecordIter;
+  void ReorderPendingLayoutRecordToTail(CXFA_ViewRecord* pNewRecord,
+                                        CXFA_ViewRecord* pPrevRecord);
+  void RemoveLayoutRecord(CXFA_ViewRecord* pNewRecord,
+                          CXFA_ViewRecord* pPrevRecord);
+  CXFA_ViewRecord* GetCurrentViewRecord() { return *m_CurrentViewRecordIter; }
+  std::list<CXFA_ViewRecord*>::iterator GetTailPosition() {
+    auto iter = m_ProposedViewRecords.end();
+    return !m_ProposedViewRecords.empty() ? std::prev(iter) : iter;
   }
-  std::list<CXFA_ContainerRecord*>::iterator GetTailPosition() {
-    auto iter = m_ProposedContainerRecords.end();
-    return !m_ProposedContainerRecords.empty() ? std::prev(iter) : iter;
-  }
-  CXFA_ContainerRecord* CreateContainerRecord(CXFA_Node* pPageNode,
-                                              bool bCreateNew);
-  void AddPageAreaLayoutItem(CXFA_ContainerRecord* pNewRecord,
+  CXFA_ViewRecord* CreateViewRecord(CXFA_Node* pPageNode, bool bCreateNew);
+  void AddPageAreaLayoutItem(CXFA_ViewRecord* pNewRecord,
                              CXFA_Node* pNewPageArea);
-  void AddContentAreaLayoutItem(CXFA_ContainerRecord* pNewRecord,
+  void AddContentAreaLayoutItem(CXFA_ViewRecord* pNewRecord,
                                 CXFA_Node* pContentArea);
   bool RunBreak(XFA_Element eBreakType,
                 XFA_AttributeValue eTargetType,
@@ -133,23 +130,22 @@
   void LayoutPageSetContents();
   void PrepareLayout();
   void SaveLayoutItem(CXFA_LayoutItem* pParentLayoutItem);
-  void ProcessSimplexOrDuplexPageSets(
-      CXFA_ContainerLayoutItem* pPageSetLayoutItem,
-      bool bIsSimplex);
+  void ProcessSimplexOrDuplexPageSets(CXFA_ViewLayoutItem* pPageSetLayoutItem,
+                                      bool bIsSimplex);
 
   CXFA_LayoutProcessor* m_pLayoutProcessor;
   CXFA_Node* m_pTemplatePageSetRoot;
-  CXFA_ContainerLayoutItem* m_pPageSetLayoutItemRoot;
-  CXFA_ContainerLayoutItem* m_pPageSetCurRoot;
-  std::list<CXFA_ContainerRecord*> m_ProposedContainerRecords;
-  std::list<CXFA_ContainerRecord*>::iterator m_CurrentContainerRecordIter;
+  CXFA_ViewLayoutItem* m_pPageSetLayoutItemRoot;
+  CXFA_ViewLayoutItem* m_pPageSetCurRoot;
+  std::list<CXFA_ViewRecord*> m_ProposedViewRecords;
+  std::list<CXFA_ViewRecord*>::iterator m_CurrentViewRecordIter;
   CXFA_Node* m_pCurPageArea;
   int32_t m_nAvailPages;
   int32_t m_nCurPageCount;
   XFA_AttributeValue m_ePageSetMode;
   bool m_bCreateOverFlowPage;
   std::map<CXFA_Node*, int32_t> m_pPageSetMap;
-  std::vector<CXFA_ContainerLayoutItem*> m_PageArray;
+  std::vector<CXFA_ViewLayoutItem*> m_PageArray;
 };
 
 #endif  // XFA_FXFA_LAYOUT_CXFA_LAYOUTPAGEMGR_H_
diff --git a/xfa/fxfa/layout/cxfa_layoutprocessor.cpp b/xfa/fxfa/layout/cxfa_layoutprocessor.cpp
index a31db89..bc87b8e 100644
--- a/xfa/fxfa/layout/cxfa_layoutprocessor.cpp
+++ b/xfa/fxfa/layout/cxfa_layoutprocessor.cpp
@@ -109,7 +109,7 @@
   return m_pLayoutPageMgr ? m_pLayoutPageMgr->GetPageCount() : 0;
 }
 
-CXFA_ContainerLayoutItem* CXFA_LayoutProcessor::GetPage(int32_t index) const {
+CXFA_ViewLayoutItem* CXFA_LayoutProcessor::GetPage(int32_t index) const {
   return m_pLayoutPageMgr ? m_pLayoutPageMgr->GetPage(index) : nullptr;
 }
 
@@ -122,7 +122,7 @@
     m_rgChangedContainers.push_back(pContainer);
 }
 
-CXFA_ContainerLayoutItem* CXFA_LayoutProcessor::GetRootLayoutItem() const {
+CXFA_ViewLayoutItem* CXFA_LayoutProcessor::GetRootLayoutItem() const {
   return m_pLayoutPageMgr ? m_pLayoutPageMgr->GetRootLayoutItem() : nullptr;
 }
 
diff --git a/xfa/fxfa/layout/cxfa_layoutprocessor.h b/xfa/fxfa/layout/cxfa_layoutprocessor.h
index b112e73..2133bef 100644
--- a/xfa/fxfa/layout/cxfa_layoutprocessor.h
+++ b/xfa/fxfa/layout/cxfa_layoutprocessor.h
@@ -13,12 +13,12 @@
 #include "core/fxcrt/fx_system.h"
 #include "core/fxcrt/unowned_ptr.h"
 
-class CXFA_ContainerLayoutItem;
 class CXFA_Document;
 class CXFA_ItemLayoutProcessor;
 class CXFA_LayoutItem;
 class CXFA_LayoutPageMgr;
 class CXFA_Node;
+class CXFA_ViewLayoutItem;
 
 class CXFA_LayoutProcessor {
  public:
@@ -30,11 +30,11 @@
   int32_t DoLayout();
   bool IncrementLayout();
   int32_t CountPages() const;
-  CXFA_ContainerLayoutItem* GetPage(int32_t index) const;
+  CXFA_ViewLayoutItem* GetPage(int32_t index) const;
   CXFA_LayoutItem* GetLayoutItem(CXFA_Node* pFormItem);
   void AddChangedContainer(CXFA_Node* pContainer);
   void SetForceReLayout(bool bForceRestart) { m_bNeedLayout = bForceRestart; }
-  CXFA_ContainerLayoutItem* GetRootLayoutItem() const;
+  CXFA_ViewLayoutItem* GetRootLayoutItem() const;
   CXFA_ItemLayoutProcessor* GetRootRootItemLayoutProcessor() const {
     return m_pRootItemLayoutProcessor.get();
   }
diff --git a/xfa/fxfa/layout/cxfa_traversestrategy_contentareacontainerlayoutitem.h b/xfa/fxfa/layout/cxfa_traversestrategy_contentareacontainerlayoutitem.h
deleted file mode 100644
index f1296cf..0000000
--- a/xfa/fxfa/layout/cxfa_traversestrategy_contentareacontainerlayoutitem.h
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2016 PDFium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
-
-#ifndef XFA_FXFA_LAYOUT_CXFA_TRAVERSESTRATEGY_CONTENTAREACONTAINERLAYOUTITEM_H_
-#define XFA_FXFA_LAYOUT_CXFA_TRAVERSESTRATEGY_CONTENTAREACONTAINERLAYOUTITEM_H_
-
-#include "xfa/fxfa/layout/cxfa_containerlayoutitem.h"
-
-class CXFA_TraverseStrategy_ContentAreaContainerLayoutItem {
- public:
-  static CXFA_ContainerLayoutItem* GetFirstChild(
-      CXFA_ContainerLayoutItem* pLayoutItem) {
-    for (CXFA_LayoutItem* pChildItem = pLayoutItem->GetFirstChild(); pChildItem;
-         pChildItem = pChildItem->GetNextSibling()) {
-      if (CXFA_ContainerLayoutItem* pContainer =
-              pChildItem->AsContainerLayoutItem()) {
-        return pContainer;
-      }
-    }
-    return nullptr;
-  }
-
-  static CXFA_ContainerLayoutItem* GetNextSibling(
-      CXFA_ContainerLayoutItem* pLayoutItem) {
-    for (CXFA_LayoutItem* pChildItem = pLayoutItem->GetNextSibling();
-         pChildItem; pChildItem = pChildItem->GetNextSibling()) {
-      if (CXFA_ContainerLayoutItem* pContainer =
-              pChildItem->AsContainerLayoutItem()) {
-        return pContainer;
-      }
-    }
-    return nullptr;
-  }
-
-  static CXFA_ContainerLayoutItem* GetParent(
-      CXFA_ContainerLayoutItem* pLayoutItem) {
-    return ToContainerLayoutItem(pLayoutItem->GetParent());
-  }
-};
-
-#endif  // XFA_FXFA_LAYOUT_CXFA_TRAVERSESTRATEGY_CONTENTAREACONTAINERLAYOUTITEM_H_
diff --git a/xfa/fxfa/layout/cxfa_traversestrategy_viewlayoutitem.h b/xfa/fxfa/layout/cxfa_traversestrategy_viewlayoutitem.h
new file mode 100644
index 0000000..5224f3a
--- /dev/null
+++ b/xfa/fxfa/layout/cxfa_traversestrategy_viewlayoutitem.h
@@ -0,0 +1,39 @@
+// Copyright 2016 PDFium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
+
+#ifndef XFA_FXFA_LAYOUT_CXFA_TRAVERSESTRATEGY_VIEWLAYOUTITEM_H_
+#define XFA_FXFA_LAYOUT_CXFA_TRAVERSESTRATEGY_VIEWLAYOUTITEM_H_
+
+#include "xfa/fxfa/layout/cxfa_viewlayoutitem.h"
+
+class CXFA_TraverseStrategy_ViewLayoutItem {
+ public:
+  static CXFA_ViewLayoutItem* GetFirstChild(CXFA_ViewLayoutItem* pLayoutItem) {
+    for (CXFA_LayoutItem* pChildItem = pLayoutItem->GetFirstChild(); pChildItem;
+         pChildItem = pChildItem->GetNextSibling()) {
+      if (CXFA_ViewLayoutItem* pContainer = pChildItem->AsViewLayoutItem()) {
+        return pContainer;
+      }
+    }
+    return nullptr;
+  }
+
+  static CXFA_ViewLayoutItem* GetNextSibling(CXFA_ViewLayoutItem* pLayoutItem) {
+    for (CXFA_LayoutItem* pChildItem = pLayoutItem->GetNextSibling();
+         pChildItem; pChildItem = pChildItem->GetNextSibling()) {
+      if (CXFA_ViewLayoutItem* pContainer = pChildItem->AsViewLayoutItem()) {
+        return pContainer;
+      }
+    }
+    return nullptr;
+  }
+
+  static CXFA_ViewLayoutItem* GetParent(CXFA_ViewLayoutItem* pLayoutItem) {
+    return ToViewLayoutItem(pLayoutItem->GetParent());
+  }
+};
+
+#endif  // XFA_FXFA_LAYOUT_CXFA_TRAVERSESTRATEGY_VIEWLAYOUTITEM_H_
diff --git a/xfa/fxfa/layout/cxfa_containerlayoutitem.cpp b/xfa/fxfa/layout/cxfa_viewlayoutitem.cpp
similarity index 72%
rename from xfa/fxfa/layout/cxfa_containerlayoutitem.cpp
rename to xfa/fxfa/layout/cxfa_viewlayoutitem.cpp
index 8617dd0..36650fd 100644
--- a/xfa/fxfa/layout/cxfa_containerlayoutitem.cpp
+++ b/xfa/fxfa/layout/cxfa_viewlayoutitem.cpp
@@ -4,7 +4,7 @@
 
 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
 
-#include "xfa/fxfa/layout/cxfa_containerlayoutitem.h"
+#include "xfa/fxfa/layout/cxfa_viewlayoutitem.h"
 
 #include "fxjs/xfa/cjx_object.h"
 #include "xfa/fxfa/layout/cxfa_layoutpagemgr.h"
@@ -13,16 +13,16 @@
 #include "xfa/fxfa/parser/cxfa_medium.h"
 #include "xfa/fxfa/parser/cxfa_node.h"
 
-CXFA_ContainerLayoutItem::CXFA_ContainerLayoutItem(CXFA_Node* pNode)
-    : CXFA_LayoutItem(pNode, kContainerItem) {}
+CXFA_ViewLayoutItem::CXFA_ViewLayoutItem(CXFA_Node* pNode)
+    : CXFA_LayoutItem(pNode, kViewItem) {}
 
-CXFA_ContainerLayoutItem::~CXFA_ContainerLayoutItem() = default;
+CXFA_ViewLayoutItem::~CXFA_ViewLayoutItem() = default;
 
-CXFA_LayoutProcessor* CXFA_ContainerLayoutItem::GetLayout() const {
+CXFA_LayoutProcessor* CXFA_ViewLayoutItem::GetLayout() const {
   return GetFormNode()->GetDocument()->GetLayoutProcessor();
 }
 
-int32_t CXFA_ContainerLayoutItem::GetPageIndex() const {
+int32_t CXFA_ViewLayoutItem::GetPageIndex() const {
   return GetFormNode()
       ->GetDocument()
       ->GetLayoutProcessor()
@@ -30,7 +30,7 @@
       ->GetPageIndex(this);
 }
 
-CFX_SizeF CXFA_ContainerLayoutItem::GetPageSize() const {
+CFX_SizeF CXFA_ViewLayoutItem::GetPageSize() const {
   CFX_SizeF size;
   CXFA_Medium* pMedium =
       GetFormNode()->GetFirstChildByClass<CXFA_Medium>(XFA_Element::Medium);
@@ -47,6 +47,6 @@
   return size;
 }
 
-CXFA_Node* CXFA_ContainerLayoutItem::GetMasterPage() const {
+CXFA_Node* CXFA_ViewLayoutItem::GetMasterPage() const {
   return GetFormNode();
 }
diff --git a/xfa/fxfa/layout/cxfa_containerlayoutitem.h b/xfa/fxfa/layout/cxfa_viewlayoutitem.h
similarity index 61%
rename from xfa/fxfa/layout/cxfa_containerlayoutitem.h
rename to xfa/fxfa/layout/cxfa_viewlayoutitem.h
index 503e4e8..6658946 100644
--- a/xfa/fxfa/layout/cxfa_containerlayoutitem.h
+++ b/xfa/fxfa/layout/cxfa_viewlayoutitem.h
@@ -4,15 +4,15 @@
 
 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
 
-#ifndef XFA_FXFA_LAYOUT_CXFA_CONTAINERLAYOUTITEM_H_
-#define XFA_FXFA_LAYOUT_CXFA_CONTAINERLAYOUTITEM_H_
+#ifndef XFA_FXFA_LAYOUT_CXFA_VIEWLAYOUTITEM_H_
+#define XFA_FXFA_LAYOUT_CXFA_VIEWLAYOUTITEM_H_
 
 #include "xfa/fxfa/layout/cxfa_layoutitem.h"
 
-class CXFA_ContainerLayoutItem : public CXFA_LayoutItem {
+class CXFA_ViewLayoutItem : public CXFA_LayoutItem {
  public:
-  explicit CXFA_ContainerLayoutItem(CXFA_Node* pNode);
-  ~CXFA_ContainerLayoutItem() override;
+  explicit CXFA_ViewLayoutItem(CXFA_Node* pNode);
+  ~CXFA_ViewLayoutItem() override;
 
   CXFA_LayoutProcessor* GetLayout() const;
   int32_t GetPageIndex() const;
@@ -22,4 +22,4 @@
   UnownedPtr<CXFA_Node> m_pOldSubform;
 };
 
-#endif  // XFA_FXFA_LAYOUT_CXFA_CONTAINERLAYOUTITEM_H_
+#endif  // XFA_FXFA_LAYOUT_CXFA_VIEWLAYOUTITEM_H_