本文整理汇总了C++中nsDisplayListSet::BorderBackground方法的典型用法代码示例。如果您正苦于以下问题:C++ nsDisplayListSet::BorderBackground方法的具体用法?C++ nsDisplayListSet::BorderBackground怎么用?C++ nsDisplayListSet::BorderBackground使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类nsDisplayListSet
的用法示例。
在下文中一共展示了nsDisplayListSet::BorderBackground方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: set
void
nsFieldSetFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
const nsRect& aDirtyRect,
const nsDisplayListSet& aLists) {
// Paint our background and border in a special way.
// REVIEW: We don't really need to check frame emptiness here; if it's empty,
// the background/border display item won't do anything, and if it isn't empty,
// we need to paint the outline
if (!(GetStateBits() & NS_FRAME_IS_OVERFLOW_CONTAINER) &&
IsVisibleForPainting(aBuilder)) {
if (StyleEffects()->mBoxShadow) {
aLists.BorderBackground()->AppendNewToTop(new (aBuilder)
nsDisplayBoxShadowOuter(aBuilder, this));
}
nsDisplayBackgroundImage::AppendBackgroundItemsToTop(
aBuilder, this, VisualBorderRectRelativeToSelf(),
aLists.BorderBackground(),
/* aAllowWillPaintBorderOptimization = */ false);
aLists.BorderBackground()->AppendNewToTop(new (aBuilder)
nsDisplayFieldSetBorderBackground(aBuilder, this));
DisplayOutlineUnconditional(aBuilder, aLists);
DO_GLOBAL_REFLOW_COUNT_DSP("nsFieldSetFrame");
}
if (GetPrevInFlow()) {
DisplayOverflowContainers(aBuilder, aDirtyRect, aLists);
}
nsDisplayListCollection contentDisplayItems;
if (nsIFrame* inner = GetInner()) {
// Collect the inner frame's display items into their own collection.
// We need to be calling BuildDisplayList on it before the legend in
// case it contains out-of-flow frames whose placeholders are in the
// legend. However, we want the inner frame's display items to be
// after the legend's display items in z-order, so we need to save them
// and append them later.
BuildDisplayListForChild(aBuilder, inner, aDirtyRect, contentDisplayItems);
}
if (nsIFrame* legend = GetLegend()) {
// The legend's background goes on our BlockBorderBackgrounds list because
// it's a block child.
nsDisplayListSet set(aLists, aLists.BlockBorderBackgrounds());
BuildDisplayListForChild(aBuilder, legend, aDirtyRect, set);
}
// Put the inner frame's display items on the master list. Note that this
// moves its border/background display items to our BorderBackground() list,
// which isn't really correct, but it's OK because the inner frame is
// anonymous and can't have its own border and background.
contentDisplayItems.MoveTo(aLists);
}
示例2: DisplayOverflowContainers
NS_IMETHODIMP
nsCanvasFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
const nsRect& aDirtyRect,
const nsDisplayListSet& aLists)
{
nsresult rv;
if (GetPrevInFlow()) {
DisplayOverflowContainers(aBuilder, aDirtyRect, aLists);
}
// Force a background to be shown. We may have a background propagated to us,
// in which case GetStyleBackground wouldn't have the right background
// and the code in nsFrame::DisplayBorderBackgroundOutline might not give us
// a background.
// We don't have any border or outline, and our background draws over
// the overflow area, so just add nsDisplayCanvasBackground instead of
// calling DisplayBorderBackgroundOutline.
if (IsVisibleForPainting(aBuilder)) {
nsStyleContext* bgSC;
const nsStyleBackground* bg = nullptr;
if (!IsThemed() &&
nsCSSRendering::FindBackground(PresContext(), this, &bgSC)) {
bg = bgSC->GetStyleBackground();
}
// Create separate items for each background layer.
NS_FOR_VISIBLE_BACKGROUND_LAYERS_BACK_TO_FRONT(i, bg) {
rv = aLists.BorderBackground()->AppendNewToTop(
new (aBuilder) nsDisplayCanvasBackground(aBuilder, this, i));
NS_ENSURE_SUCCESS(rv, rv);
}
}
示例3: WrapLists
nsresult nsDisplayWrapper::WrapLists(nsDisplayListBuilder* aBuilder,
nsIFrame* aFrame, const nsDisplayListSet& aIn, const nsDisplayListSet& aOut)
{
nsresult rv = WrapListsInPlace(aBuilder, aFrame, aIn);
NS_ENSURE_SUCCESS(rv, rv);
if (&aOut == &aIn)
return NS_OK;
aOut.BorderBackground()->AppendToTop(aIn.BorderBackground());
aOut.BlockBorderBackgrounds()->AppendToTop(aIn.BlockBorderBackgrounds());
aOut.Floats()->AppendToTop(aIn.Floats());
aOut.Content()->AppendToTop(aIn.Content());
aOut.PositionedDescendants()->AppendToTop(aIn.PositionedDescendants());
aOut.Outlines()->AppendToTop(aIn.Outlines());
return NS_OK;
}
示例4: MoveTo
void nsDisplayListSet::MoveTo(const nsDisplayListSet& aDestination) const
{
aDestination.BorderBackground()->AppendToTop(BorderBackground());
aDestination.BlockBorderBackgrounds()->AppendToTop(BlockBorderBackgrounds());
aDestination.Floats()->AppendToTop(Floats());
aDestination.Content()->AppendToTop(Content());
aDestination.PositionedDescendants()->AppendToTop(PositionedDescendants());
aDestination.Outlines()->AppendToTop(Outlines());
}
示例5: nsDisplaymtdBorder
nsresult
nsMathMLmtdFrame::ProcessBorders(nsTableFrame* aFrame,
nsDisplayListBuilder* aBuilder,
const nsDisplayListSet& aLists)
{
aLists.BorderBackground()->AppendNewToTop(new (aBuilder)
nsDisplaymtdBorder(aBuilder, this));
return NS_OK;
}
示例6: rect
void
nsHTMLButtonControlFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
const nsRect& aDirtyRect,
const nsDisplayListSet& aLists)
{
// Clip to our border area for event hit testing.
Maybe<DisplayListClipState::AutoSaveRestore> eventClipState;
const bool isForEventDelivery = aBuilder->IsForEventDelivery();
if (isForEventDelivery) {
eventClipState.emplace(aBuilder);
nsRect rect(aBuilder->ToReferenceFrame(this), GetSize());
nscoord radii[8];
bool hasRadii = GetBorderRadii(radii);
eventClipState->ClipContainingBlockDescendants(rect, hasRadii ? radii : nullptr);
}
nsDisplayList onTop;
if (IsVisibleForPainting(aBuilder)) {
mRenderer.DisplayButton(aBuilder, aLists.BorderBackground(), &onTop);
}
nsDisplayListCollection set;
// Do not allow the child subtree to receive events.
if (!isForEventDelivery) {
DisplayListClipState::AutoSaveRestore clipState(aBuilder);
if (IsInput() || StyleDisplay()->mOverflowX != NS_STYLE_OVERFLOW_VISIBLE) {
nsMargin border = StyleBorder()->GetComputedBorder();
nsRect rect(aBuilder->ToReferenceFrame(this), GetSize());
rect.Deflate(border);
nscoord radii[8];
bool hasRadii = GetPaddingBoxBorderRadii(radii);
clipState.ClipContainingBlockDescendants(rect, hasRadii ? radii : nullptr);
}
BuildDisplayListForChild(aBuilder, mFrames.FirstChild(), aDirtyRect, set,
DISPLAY_CHILD_FORCE_PSEUDO_STACKING_CONTEXT);
// That should put the display items in set.Content()
}
// Put the foreground outline and focus rects on top of the children
set.Content()->AppendToTop(&onTop);
set.MoveTo(aLists);
DisplayOutline(aBuilder, aLists);
// to draw border when selected in editor
DisplaySelectionOverlay(aBuilder, aLists.Content());
}
示例7: DisplayBorderBackgroundOutline
void
nsColumnSetFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
const nsRect& aDirtyRect,
const nsDisplayListSet& aLists) {
DisplayBorderBackgroundOutline(aBuilder, aLists);
aLists.BorderBackground()->AppendNewToTop(new (aBuilder)
nsDisplayGenericOverflow(aBuilder, this, ::PaintColumnRule, "ColumnRule",
nsDisplayItem::TYPE_COLUMN_RULE));
// Our children won't have backgrounds so it doesn't matter where we put them.
for (nsFrameList::Enumerator e(mFrames); !e.AtEnd(); e.Next()) {
BuildDisplayListForChild(aBuilder, e.get(), aDirtyRect, aLists);
}
}
示例8: nsDisplayXULGroupBackground
void
nsGroupBoxFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
const nsRect& aDirtyRect,
const nsDisplayListSet& aLists)
{
// Paint our background and border
if (IsVisibleForPainting(aBuilder)) {
aLists.BorderBackground()->AppendNewToTop(new (aBuilder)
nsDisplayXULGroupBackground(aBuilder, this));
DisplayOutline(aBuilder, aLists);
}
BuildDisplayListForChildren(aBuilder, aDirtyRect, aLists);
}
示例9: StyleBorder
nsresult
nsTableCellFrame::ProcessBorders(nsTableFrame* aFrame,
nsDisplayListBuilder* aBuilder,
const nsDisplayListSet& aLists)
{
const nsStyleBorder* borderStyle = StyleBorder();
if (aFrame->IsBorderCollapse() || !borderStyle->HasBorder())
return NS_OK;
if (!GetContentEmpty() ||
StyleTableBorder()->mEmptyCells == NS_STYLE_TABLE_EMPTY_CELLS_SHOW) {
aLists.BorderBackground()->AppendNewToTop(new (aBuilder)
nsDisplayBorder(aBuilder, this));
}
return NS_OK;
}
示例10: rect
NS_IMETHODIMP
nsHTMLButtonControlFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
const nsRect& aDirtyRect,
const nsDisplayListSet& aLists)
{
nsDisplayList onTop;
if (IsVisibleForPainting(aBuilder)) {
nsresult rv = mRenderer.DisplayButton(aBuilder, aLists.BorderBackground(), &onTop);
NS_ENSURE_SUCCESS(rv, rv);
}
nsDisplayListCollection set;
// Do not allow the child subtree to receive events.
if (!aBuilder->IsForEventDelivery()) {
nsresult rv =
BuildDisplayListForChild(aBuilder, mFrames.FirstChild(), aDirtyRect, set,
DISPLAY_CHILD_FORCE_PSEUDO_STACKING_CONTEXT);
NS_ENSURE_SUCCESS(rv, rv);
// That should put the display items in set.Content()
}
// Put the foreground outline and focus rects on top of the children
set.Content()->AppendToTop(&onTop);
// clips to our padding box for <input>s but not <button>s, unless
// they have non-visible overflow..
if (IsInput() || GetStyleDisplay()->mOverflowX != NS_STYLE_OVERFLOW_VISIBLE) {
nsMargin border = GetStyleBorder()->GetComputedBorder();
nsRect rect(aBuilder->ToReferenceFrame(this), GetSize());
rect.Deflate(border);
nscoord radii[8];
GetPaddingBoxBorderRadii(radii);
nsresult rv = OverflowClip(aBuilder, set, aLists, rect, radii);
NS_ENSURE_SUCCESS(rv, rv);
} else {
set.MoveTo(aLists);
}
nsresult rv = DisplayOutline(aBuilder, aLists);
NS_ENSURE_SUCCESS(rv, rv);
// to draw border when selected in editor
return DisplaySelectionOverlay(aBuilder, aLists.Content());
}
示例11: BuildDisplayListForChildren
NS_IMETHODIMP
nsGroupBoxFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
const nsRect& aDirtyRect,
const nsDisplayListSet& aLists)
{
// Paint our background and border
if (IsVisibleForPainting(aBuilder)) {
nsresult rv = aLists.BorderBackground()->AppendNewToTop(new (aBuilder)
nsDisplayXULGroupBackground(this));
NS_ENSURE_SUCCESS(rv, rv);
rv = DisplayOutline(aBuilder, aLists);
NS_ENSURE_SUCCESS(rv, rv);
}
return BuildDisplayListForChildren(aBuilder, aDirtyRect, aLists);
// REVIEW: Debug borders now painted by nsFrame::BuildDisplayListForChild
}
示例12: DisplayBorderBackgroundOutline
NS_IMETHODIMP
nsColumnSetFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
const nsRect& aDirtyRect,
const nsDisplayListSet& aLists) {
nsresult rv = DisplayBorderBackgroundOutline(aBuilder, aLists);
NS_ENSURE_SUCCESS(rv, rv);
aLists.BorderBackground()->AppendNewToTop(new (aBuilder)
nsDisplayGeneric(aBuilder, this, ::PaintColumnRule, "ColumnRule",
nsDisplayItem::TYPE_COLUMN_RULE));
// Our children won't have backgrounds so it doesn't matter where we put them.
for (nsFrameList::Enumerator e(mFrames); !e.AtEnd(); e.Next()) {
nsresult rv = BuildDisplayListForChild(aBuilder, e.get(),
aDirtyRect, aLists);
NS_ENSURE_SUCCESS(rv, rv);
}
return NS_OK;
}
示例13: PrintDisplayListSetItem
void
nsFrame::PrintDisplayListSet(nsDisplayListBuilder* aBuilder,
const nsDisplayListSet& aSet,
std::stringstream& aStream,
bool aDumpHtml)
{
if (aDumpHtml) {
aStream << "<ul>";
}
PrintDisplayListSetItem(aBuilder, "[BorderBackground]", *(aSet.BorderBackground()), aStream, aDumpHtml);
PrintDisplayListSetItem(aBuilder, "[BlockBorderBackgrounds]", *(aSet.BlockBorderBackgrounds()), aStream, aDumpHtml);
PrintDisplayListSetItem(aBuilder, "[Floats]", *(aSet.Floats()), aStream, aDumpHtml);
PrintDisplayListSetItem(aBuilder, "[PositionedDescendants]", *(aSet.PositionedDescendants()), aStream, aDumpHtml);
PrintDisplayListSetItem(aBuilder, "[Outlines]", *(aSet.Outlines()), aStream, aDumpHtml);
PrintDisplayListSetItem(aBuilder, "[Content]", *(aSet.Content()), aStream, aDumpHtml);
if (aDumpHtml) {
aStream << "</ul>";
}
}
示例14: clipRect
NS_IMETHODIMP
nsFileControlFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
const nsRect& aDirtyRect,
const nsDisplayListSet& aLists)
{
// box-shadow
if (GetStyleBorder()->mBoxShadow) {
nsresult rv = aLists.BorderBackground()->AppendNewToTop(new (aBuilder)
nsDisplayBoxShadowOuter(aBuilder, this));
NS_ENSURE_SUCCESS(rv, rv);
}
// Our background is inherited to the text input, and we don't really want to
// paint it or out padding and borders (which we never have anyway, per
// styles in forms.css) -- doing it just makes us look ugly in some cases and
// has no effect in others.
nsDisplayListCollection tempList;
nsresult rv = nsBlockFrame::BuildDisplayList(aBuilder, aDirtyRect, tempList);
if (NS_FAILED(rv))
return rv;
tempList.BorderBackground()->DeleteAll();
// Clip height only
nsRect clipRect(aBuilder->ToReferenceFrame(this), GetSize());
clipRect.width = GetVisualOverflowRect().XMost();
nscoord radii[8] = {0, 0, 0, 0, 0, 0, 0, 0};
rv = OverflowClip(aBuilder, tempList, aLists, clipRect, radii);
NS_ENSURE_SUCCESS(rv, rv);
// Disabled file controls don't pass mouse events to their children, so we
// put an invisible item in the display list above the children
// just to catch events
nsEventStates eventStates = mContent->AsElement()->State();
if (eventStates.HasState(NS_EVENT_STATE_DISABLED) && IsVisibleForPainting(aBuilder)) {
rv = aLists.Content()->AppendNewToTop(
new (aBuilder) nsDisplayEventReceiver(aBuilder, this));
if (NS_FAILED(rv))
return rv;
}
return DisplaySelectionOverlay(aBuilder, aLists.Content());
}
示例15: DisplayBorderBackgroundOutline
NS_IMETHODIMP
nsColumnSetFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
const nsRect& aDirtyRect,
const nsDisplayListSet& aLists) {
nsresult rv = DisplayBorderBackgroundOutline(aBuilder, aLists);
NS_ENSURE_SUCCESS(rv, rv);
aLists.BorderBackground()->AppendNewToTop(new (aBuilder)
nsDisplayGeneric(aBuilder, this, ::PaintColumnRule, "ColumnRule",
nsDisplayItem::TYPE_COLUMN_RULE));
nsIFrame* kid = mFrames.FirstChild();
// Our children won't have backgrounds so it doesn't matter where we put them.
while (kid) {
nsresult rv = BuildDisplayListForChild(aBuilder, kid, aDirtyRect, aLists);
NS_ENSURE_SUCCESS(rv, rv);
kid = kid->GetNextSibling();
}
return NS_OK;
}