static void dumpDescendantFrameScrollPositions(WKBundleFrameRef frame) { WKRetainPtr<WKArrayRef> childFrames(AdoptWK, WKBundleFrameCopyChildFrames(frame)); size_t size = WKArrayGetSize(childFrames.get()); for (size_t i = 0; i < size; ++i) { WKBundleFrameRef subframe = static_cast<WKBundleFrameRef>(WKArrayGetItemAtIndex(childFrames.get(), i)); dumpFrameScrollPosition(subframe, ShouldIncludeFrameName); dumpDescendantFrameScrollPositions(subframe); } }
void nsPopupSetFrame::List(FILE* out, int32_t aIndent, uint32_t aFlags) const { ListGeneric(out, aIndent, aFlags); // Output the children bool outputOneList = false; ChildListIterator lists(this); for (; !lists.IsDone(); lists.Next()) { if (outputOneList) { IndentBy(out, aIndent); } outputOneList = true; fprintf(out, "%s<\n", mozilla::layout::ChildListName(lists.CurrentID())); nsFrameList::Enumerator childFrames(lists.CurrentList()); for (; !childFrames.AtEnd(); childFrames.Next()) { nsIFrame* kid = childFrames.get(); // Verify the child frame's parent frame pointer is correct NS_ASSERTION(kid->GetParent() == this, "bad parent frame pointer"); // Have the child frame list kid->List(out, aIndent + 1, aFlags); } IndentBy(out, aIndent); fputs(">\n", out); } // XXXmats the above is copy-pasted from nsContainerFrame::List which is lame, // clean this up after bug 399111 is implemented. if (!mPopupList.IsEmpty()) { fputs("<\n", out); ++aIndent; IndentBy(out, aIndent); fputs(mozilla::layout::ChildListName(kPopupList), out); fputs(" for ", out); ListTag(out); fputs(" <\n", out); ++aIndent; for (nsFrameList::Enumerator e(mPopupList); !e.AtEnd(); e.Next()) { e.get()->List(out, aIndent, aFlags); } --aIndent; IndentBy(out, aIndent); fputs(">\n", out); --aIndent; IndentBy(out, aIndent); fputs(">\n", out); outputOneList = true; } if (!outputOneList) { fputs("<>\n", out); } }
static void dumpDescendantFramesText(WKBundleFrameRef frame) { WKRetainPtr<WKArrayRef> childFrames(AdoptWK, WKBundleFrameCopyChildFrames(frame)); size_t size = WKArrayGetSize(childFrames.get()); for (size_t i = 0; i < size; ++i) { WKBundleFrameRef subframe = static_cast<WKBundleFrameRef>(WKArrayGetItemAtIndex(childFrames.get(), i)); WKRetainPtr<WKStringRef> subframeName(AdoptWK, WKBundleFrameCopyName(subframe)); InjectedBundle::shared().os() << "\n--------\nFrame: '" << subframeName << "'\n--------\n"; dumpFrameText(subframe); dumpDescendantFramesText(subframe); } }
/* static */ void nsFontFaceUtils::MarkDirtyForFontChange(nsIFrame* aSubtreeRoot, const gfxUserFontEntry* aFont) { AutoTArray<nsIFrame*, 4> subtrees; subtrees.AppendElement(aSubtreeRoot); nsIPresShell* ps = aSubtreeRoot->PresContext()->PresShell(); // check descendants, iterating over subtrees that may include // additional subtrees associated with placeholders do { nsIFrame* subtreeRoot = subtrees.ElementAt(subtrees.Length() - 1); subtrees.RemoveElementAt(subtrees.Length() - 1); // Check all descendants to see if they use the font AutoTArray<nsIFrame*, 32> stack; stack.AppendElement(subtreeRoot); do { nsIFrame* f = stack.ElementAt(stack.Length() - 1); stack.RemoveElementAt(stack.Length() - 1); // if this frame uses the font, mark its descendants dirty // and skip checking its children if (FrameUsesFont(f, aFont)) { ScheduleReflow(ps, f); } else { if (f->GetType() == nsGkAtoms::placeholderFrame) { nsIFrame* oof = nsPlaceholderFrame::GetRealFrameForPlaceholder(f); if (!nsLayoutUtils::IsProperAncestorFrame(subtreeRoot, oof)) { // We have another distinct subtree we need to mark. subtrees.AppendElement(oof); } } nsIFrame::ChildListIterator lists(f); for (; !lists.IsDone(); lists.Next()) { nsFrameList::Enumerator childFrames(lists.CurrentList()); for (; !childFrames.AtEnd(); childFrames.Next()) { nsIFrame* kid = childFrames.get(); stack.AppendElement(kid); } } } } while (!stack.IsEmpty()); } while (!subtrees.IsEmpty()); }
NS_IMETHODIMP nsPopupSetFrame::List(FILE* out, int32_t aIndent, uint32_t aFlags) const { IndentBy(out, aIndent); ListTag(out); #ifdef DEBUG_waterson fprintf(out, " [parent=%p]", static_cast<void*>(mParent)); #endif if (HasView()) { fprintf(out, " [view=%p]", static_cast<void*>(GetView())); } if (GetNextSibling()) { fprintf(out, " next=%p", static_cast<void*>(GetNextSibling())); } if (nullptr != GetPrevContinuation()) { fprintf(out, " prev-continuation=%p", static_cast<void*>(GetPrevContinuation())); } if (nullptr != GetNextContinuation()) { fprintf(out, " next-continuation=%p", static_cast<void*>(GetNextContinuation())); } fprintf(out, " {%d,%d,%d,%d}", mRect.x, mRect.y, mRect.width, mRect.height); if (0 != mState) { fprintf(out, " [state=%016llx]", (unsigned long long)mState); } fprintf(out, " [content=%p]", static_cast<void*>(mContent)); nsPopupSetFrame* f = const_cast<nsPopupSetFrame*>(this); if (f->HasOverflowAreas()) { nsRect overflowArea = f->GetVisualOverflowRect(); fprintf(out, " [vis-overflow=%d,%d,%d,%d]", overflowArea.x, overflowArea.y, overflowArea.width, overflowArea.height); overflowArea = f->GetScrollableOverflowRect(); fprintf(out, " [scr-overflow=%d,%d,%d,%d]", overflowArea.x, overflowArea.y, overflowArea.width, overflowArea.height); } fprintf(out, " [sc=%p]", static_cast<void*>(mStyleContext)); nsIAtom* pseudoTag = mStyleContext->GetPseudo(); if (pseudoTag) { nsAutoString atomString; pseudoTag->ToString(atomString); fprintf(out, " pst=%s", NS_LossyConvertUTF16toASCII(atomString).get()); } // Output the children bool outputOneList = false; ChildListIterator lists(this); for (; !lists.IsDone(); lists.Next()) { if (outputOneList) { IndentBy(out, aIndent); } outputOneList = true; fprintf(out, "%s<\n", mozilla::layout::ChildListName(lists.CurrentID())); nsFrameList::Enumerator childFrames(lists.CurrentList()); for (; !childFrames.AtEnd(); childFrames.Next()) { nsIFrame* kid = childFrames.get(); // Verify the child frame's parent frame pointer is correct NS_ASSERTION(kid->GetParent() == this, "bad parent frame pointer"); // Have the child frame list kid->List(out, aIndent + 1, aFlags); } IndentBy(out, aIndent); fputs(">\n", out); } // XXXmats the above is copy-pasted from nsContainerFrame::List which is lame, // clean this up after bug 399111 is implemented. if (!mPopupList.IsEmpty()) { fputs("<\n", out); ++aIndent; IndentBy(out, aIndent); fputs(mozilla::layout::ChildListName(kPopupList), out); fputs(" for ", out); ListTag(out); fputs(" <\n", out); ++aIndent; for (nsFrameList::Enumerator e(mPopupList); !e.AtEnd(); e.Next()) { e.get()->List(out, aIndent, aFlags); } --aIndent; IndentBy(out, aIndent); fputs(">\n", out); --aIndent; IndentBy(out, aIndent); fputs(">\n", out); outputOneList = true; } if (!outputOneList) { fputs("<>\n", out); } return NS_OK; }