当前位置: 首页>>代码示例>>C++>>正文


C++ nsFrameList类代码示例

本文整理汇总了C++中nsFrameList的典型用法代码示例。如果您正苦于以下问题:C++ nsFrameList类的具体用法?C++ nsFrameList怎么用?C++ nsFrameList使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了nsFrameList类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1:

NS_IMETHODIMP 
nsTableOuterFrame::SetInitialChildList(nsIAtom*        aListName,
                                       nsFrameList&    aChildList)
{
  if (nsGkAtoms::captionList == aListName) {
    // the frame constructor already checked for table-caption display type
    mCaptionFrames.SetFrames(aChildList);
    mCaptionFrame = mCaptionFrames.FirstChild();
  }
  else {
    NS_ASSERTION(!aListName, "wrong childlist");
    NS_ASSERTION(mFrames.IsEmpty(), "Frame leak!");
    mInnerTableFrame = nsnull;
    if (aChildList.NotEmpty()) {
      if (nsGkAtoms::tableFrame == aChildList.FirstChild()->GetType()) {
        mInnerTableFrame = (nsTableFrame*)aChildList.FirstChild();
        mFrames.SetFrames(aChildList);
      }
      else {
        NS_ERROR("expected a table frame");
        return NS_ERROR_INVALID_ARG;
      }
    }
  }

  return NS_OK;
}
开发者ID:Akin-Net,项目名称:mozilla-central,代码行数:27,代码来源:nsTableOuterFrame.cpp

示例2: PresContext

NS_IMETHODIMP
nsTableOuterFrame::AppendFrames(ChildListID     aListID,
                                nsFrameList&    aFrameList)
{
  nsresult rv;

  // We only have two child frames: the inner table and a caption frame.
  // The inner frame is provided when we're initialized, and it cannot change
  if (kCaptionList == aListID) {
    NS_ASSERTION(aFrameList.IsEmpty() ||
                 aFrameList.FirstChild()->GetType() == nsGkAtoms::tableCaptionFrame,
                 "appending non-caption frame to captionList");
    mCaptionFrames.AppendFrames(this, aFrameList);
    rv = NS_OK;

    // Reflow the new caption frame. It's already marked dirty, so
    // just tell the pres shell.
    PresContext()->PresShell()->
      FrameNeedsReflow(this, nsIPresShell::eTreeChange,
                       NS_FRAME_HAS_DIRTY_CHILDREN);
  }
  else {
    NS_PRECONDITION(false, "unexpected child list");
    rv = NS_ERROR_UNEXPECTED;
  }

  return rv;
}
开发者ID:lofter2011,项目名称:Icefox,代码行数:28,代码来源:nsTableOuterFrame.cpp

示例3: AppendFrames

NS_IMETHODIMP
nsTableOuterFrame::InsertFrames(ChildListID     aListID,
                                nsIFrame*       aPrevFrame,
                                nsFrameList&    aFrameList)
{
  if (kCaptionList == aListID) {
    NS_ASSERTION(!aPrevFrame || aPrevFrame->GetParent() == this,
                 "inserting after sibling frame with different parent");
    NS_ASSERTION(aFrameList.IsEmpty() ||
                 aFrameList.FirstChild()->GetType() == nsGkAtoms::tableCaptionFrame,
                 "inserting non-caption frame into captionList");
    mCaptionFrames.InsertFrames(nsnull, aPrevFrame, aFrameList);

    // Reflow the new caption frame. It's already marked dirty, so
    // just tell the pres shell.
    PresContext()->PresShell()->
      FrameNeedsReflow(this, nsIPresShell::eTreeChange,
                       NS_FRAME_HAS_DIRTY_CHILDREN);
    return NS_OK;
  }
  else {
    NS_PRECONDITION(!aPrevFrame, "invalid previous frame");
    return AppendFrames(aListID, aFrameList);
  }
}
开发者ID:lofter2011,项目名称:Icefox,代码行数:25,代码来源:nsTableOuterFrame.cpp

示例4: while

nsresult
nsPopupSetFrame::AddPopupFrameList(nsFrameList& aPopupFrameList)
{
  while (!aPopupFrameList.IsEmpty()) {
    nsIFrame* f = aPopupFrameList.FirstChild();
    // Clears out prev/next sibling points appropriately. Every frame
    // in our popup list has null next and prev pointers, they're logically
    // each in their own list.
    aPopupFrameList.RemoveFrame(f);
    nsresult rv = AddPopupFrame(f);
    NS_ENSURE_SUCCESS(rv, rv);
  }
  return NS_OK;
}
开发者ID:svaithee12,项目名称:firefox,代码行数:14,代码来源:nsPopupSetFrame.cpp

示例5: GetChildList

NS_IMETHODIMP
nsSVGDisplayContainerFrame::InsertFrames(ChildListID aListID,
                                         nsIFrame* aPrevFrame,
                                         nsFrameList& aFrameList)
{
  // memorize first old frame after insertion point
  // XXXbz once again, this would work a lot better if the nsIFrame
  // methods returned framelist iterators....
  nsIFrame* firstOldFrame = aPrevFrame ?
    aPrevFrame->GetNextSibling() : GetChildList(aListID).FirstChild();
  nsIFrame* firstNewFrame = aFrameList.FirstChild();
  
  // Insert the new frames
  nsSVGContainerFrame::InsertFrames(aListID, aPrevFrame, aFrameList);

  // Call InitialUpdate on the new frames ONLY if our nsSVGOuterSVGFrame has had
  // its initial reflow (our NS_FRAME_FIRST_REFLOW bit is clear) - bug 399863.
  if (!(GetStateBits() & NS_FRAME_FIRST_REFLOW)) {
    for (nsIFrame* kid = firstNewFrame; kid != firstOldFrame;
         kid = kid->GetNextSibling()) {
      nsISVGChildFrame* SVGFrame = do_QueryFrame(kid);
      if (SVGFrame) {
        SVGFrame->InitialUpdate(); 
      }
    }
  }

  return NS_OK;
}
开发者ID:Anachid,项目名称:mozilla-central,代码行数:29,代码来源:nsSVGContainerFrame.cpp

示例6: GetSpan

// don't set mColCount here, it is done in AddColsToTable
NS_IMETHODIMP
nsTableColGroupFrame::SetInitialChildList(ChildListID     aListID,
                                          nsFrameList&    aChildList)
{
  if (!mFrames.IsEmpty()) {
    // We already have child frames which means we've already been
    // initialized
    NS_NOTREACHED("unexpected second call to SetInitialChildList");
    return NS_ERROR_UNEXPECTED;
  }
  if (aListID != kPrincipalList) {
    // All we know about is the principal child list.
    NS_NOTREACHED("unknown frame list");
    return NS_ERROR_INVALID_ARG;
  } 
  nsTableFrame* tableFrame = nsTableFrame::GetTableFrame(this);
  if (aChildList.IsEmpty()) {
    tableFrame->AppendAnonymousColFrames(this, GetSpan(), eColAnonymousColGroup, 
                                         false);
    return NS_OK; 
  }

  mFrames.AppendFrames(this, aChildList);
  return NS_OK;
}
开发者ID:lofter2011,项目名称:Icefox,代码行数:26,代码来源:nsTableColGroupFrame.cpp

示例7: state

void
nsMenuFrame::InsertFrames(ChildListID     aListID,
                          nsIFrame*       aPrevFrame,
                          nsFrameList&    aFrameList)
{
  if (!HasPopup() && (aListID == kPrincipalList || aListID == kPopupList)) {
    SetPopupFrame(aFrameList);
    if (HasPopup()) {
#ifdef DEBUG_LAYOUT
      nsBoxLayoutState state(PresContext());
      SetXULDebug(state, aFrameList, mState & NS_STATE_CURRENTLY_IN_DEBUG);
#endif

      PresContext()->PresShell()->
        FrameNeedsReflow(this, nsIPresShell::eTreeChange,
                         NS_FRAME_HAS_DIRTY_CHILDREN);
    }
  }

  if (aFrameList.IsEmpty())
    return;

  if (MOZ_UNLIKELY(aPrevFrame && aPrevFrame == GetPopup())) {
    aPrevFrame = nullptr;
  }

  nsBoxFrame::InsertFrames(aListID, aPrevFrame, aFrameList);
}
开发者ID:flodolo,项目名称:gecko-dev,代码行数:28,代码来源:nsMenuFrame.cpp

示例8:

void
nsColumnSetFrame::SetInitialChildList(ChildListID     aListID,
                                      nsFrameList&    aChildList)
{
  MOZ_ASSERT(aListID != kPrincipalList || aChildList.OnlyChild(),
             "initial principal child list must have exactly one child");
  nsContainerFrame::SetInitialChildList(kPrincipalList, aChildList);
}
开发者ID:mephisto41,项目名称:gecko-dev,代码行数:8,代码来源:nsColumnSetFrame.cpp

示例9: PresContext

void
nsTableWrapperFrame::AppendFrames(ChildListID     aListID,
                                  nsFrameList&    aFrameList)
{
  // We only have two child frames: the inner table and a caption frame.
  // The inner frame is provided when we're initialized, and it cannot change
  MOZ_ASSERT(kCaptionList == aListID, "unexpected child list");
  MOZ_ASSERT(aFrameList.IsEmpty() ||
             aFrameList.FirstChild()->IsTableCaption(),
             "appending non-caption frame to captionList");
  mCaptionFrames.AppendFrames(this, aFrameList);

  // Reflow the new caption frame. It's already marked dirty, so
  // just tell the pres shell.
  PresContext()->PresShell()->FrameNeedsReflow(this, nsIPresShell::eTreeChange,
                                               NS_FRAME_HAS_DIRTY_CHILDREN);
}
开发者ID:bitwiseworks,项目名称:mozilla-os2,代码行数:17,代码来源:nsTableWrapperFrame.cpp

示例10:

void
nsTableWrapperFrame::SetInitialChildList(ChildListID     aListID,
                                         nsFrameList&    aChildList)
{
  if (kCaptionList == aListID) {
    // the frame constructor already checked for table-caption display type
    MOZ_ASSERT(mCaptionFrames.IsEmpty(),
               "already have child frames in CaptionList");
    mCaptionFrames.SetFrames(aChildList);
  } else {
    MOZ_ASSERT(kPrincipalList != aListID ||
               (aChildList.FirstChild() &&
                aChildList.FirstChild() == aChildList.LastChild() &&
                nsGkAtoms::tableFrame == aChildList.FirstChild()->GetType()),
               "expected a single table frame in principal child list");
    nsContainerFrame::SetInitialChildList(aListID, aChildList);
  }
}
开发者ID:bitwiseworks,项目名称:mozilla-os2,代码行数:18,代码来源:nsTableWrapperFrame.cpp

示例11:

NS_IMETHODIMP 
nsTableOuterFrame::SetInitialChildList(ChildListID     aListID,
                                       nsFrameList&    aChildList)
{
  if (kCaptionList == aListID) {
    // the frame constructor already checked for table-caption display type
    mCaptionFrames.SetFrames(aChildList);
  }
  else {
    NS_ASSERTION(aListID == kPrincipalList, "wrong childlist");
    NS_ASSERTION(mFrames.IsEmpty(), "Frame leak!");
    NS_ASSERTION(aChildList.FirstChild() &&
                 nsGkAtoms::tableFrame == aChildList.FirstChild()->GetType(),
                 "expected a table frame");
    mFrames.SetFrames(aChildList);
  }

  return NS_OK;
}
开发者ID:lofter2011,项目名称:Icefox,代码行数:19,代码来源:nsTableOuterFrame.cpp

示例12:

void 
nsTableOuterFrame::SetInitialChildList(ChildListID     aListID,
                                       nsFrameList&    aChildList)
{
  MOZ_ASSERT(kCaptionList == aListID || aListID == kPrincipalList,
             "unexpected child list");
  MOZ_ASSERT(GetChildList(aListID).IsEmpty(),
             "already have child frames in SetInitialChildList");

  if (kCaptionList == aListID) {
    // the frame constructor already checked for table-caption display type
    mCaptionFrames.SetFrames(aChildList);
  } else {
    MOZ_ASSERT(aChildList.FirstChild() &&
               aChildList.FirstChild() == aChildList.LastChild() &&
               nsGkAtoms::tableFrame == aChildList.FirstChild()->GetType(),
               "expected a single table frame");
    mFrames.SetFrames(aChildList);
  }
}
开发者ID:msliu,项目名称:gecko-dev,代码行数:20,代码来源:nsTableOuterFrame.cpp

示例13: SetInitialChildList

NS_IMETHODIMP
nsColumnSetFrame::SetInitialChildList(ChildListID     aListID,
                                      nsFrameList&    aChildList)
{
  NS_ASSERTION(aListID == kPrincipalList,
               "Only default child list supported");
  NS_ASSERTION(aChildList.OnlyChild(),
               "initial child list must have exactly one child");
  // Queue up the frames for the content frame
  return nsContainerFrame::SetInitialChildList(kPrincipalList, aChildList);
}
开发者ID:TheTypoMaster,项目名称:fennec-777045,代码行数:11,代码来源:nsColumnSetFrame.cpp

示例14:

void
DetailsFrame::SetInitialChildList(ChildListID aListID, nsFrameList& aChildList)
{
  if (aListID == kPrincipalList) {
    auto* details = HTMLDetailsElement::FromContent(GetContent());
    bool isOpen = details->Open();

    if (isOpen) {
      // If details is open, the first summary needs to be rendered as if it is
      // the first child.
      for (nsIFrame* child : aChildList) {
        auto* realFrame = nsPlaceholderFrame::GetRealFrameFor(child);
        auto* cif = realFrame->GetContentInsertionFrame();
        if (cif && cif->GetType() == nsGkAtoms::summaryFrame) {
          // Take out the first summary frame and insert it to the beginning of
          // the list.
          aChildList.RemoveFrame(child);
          aChildList.InsertFrame(nullptr, nullptr, child);
          break;
        }
      }
    }

#ifdef DEBUG
    nsIFrame* realFrame =
      nsPlaceholderFrame::GetRealFrameFor(isOpen ?
                                          aChildList.FirstChild() :
                                          aChildList.OnlyChild());
    MOZ_ASSERT(realFrame, "Principal list of details should not be empty!");
    nsIFrame* summaryFrame = realFrame->GetContentInsertionFrame();
    MOZ_ASSERT(summaryFrame->GetType() == nsGkAtoms::summaryFrame,
               "The frame should be summary frame!");
#endif

  }

  nsBlockFrame::SetInitialChildList(aListID, aChildList);
}
开发者ID:cbradley857,项目名称:gecko-dev,代码行数:38,代码来源:DetailsFrame.cpp

示例15: do_QueryFrame

void
nsMenuFrame::SetPopupFrame(nsFrameList& aFrameList)
{
  for (nsFrameList::Enumerator e(aFrameList); !e.AtEnd(); e.Next()) {
    nsMenuPopupFrame* popupFrame = do_QueryFrame(e.get());
    if (popupFrame) {
      // Remove the frame from the list and store it in a nsFrameList* property.
      aFrameList.RemoveFrame(popupFrame);
      nsFrameList* popupList = new (PresContext()->PresShell()) nsFrameList(popupFrame, popupFrame);
      Properties().Set(PopupListProperty(), popupList);
      AddStateBits(NS_STATE_MENU_HAS_POPUP_LIST);
      break;
    }
  }
}
开发者ID:flodolo,项目名称:gecko-dev,代码行数:15,代码来源:nsMenuFrame.cpp


注:本文中的nsFrameList类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。