--- a/layout/base/nsCSSFrameConstructor.cpp
+++ b/layout/base/nsCSSFrameConstructor.cpp
@@ -3162,17 +3162,17 @@ nsCSSFrameConstructor::ConstructSelectFr
return listFrame;
}
/**
* Used to be InitializeScrollFrame but now it's only used for the select tag
* But the select tag should really be fixed to use GFX scrollbars that can
* be create with BuildScrollFrame.
*/
-nsresult
+void
nsCSSFrameConstructor::InitializeSelectFrame(nsFrameConstructorState& aState,
nsContainerFrame* scrollFrame,
nsContainerFrame* scrolledFrame,
nsIContent* aContent,
nsContainerFrame* aParentFrame,
nsStyleContext* aStyleContext,
bool aBuildCombobox,
PendingBinding* aPendingBinding,
@@ -3208,17 +3208,16 @@ nsCSSFrameConstructor::InitializeSelectF
// Process children
nsFrameItems childItems;
ProcessChildren(aState, aContent, aStyleContext, scrolledFrame, false,
childItems, false, aPendingBinding);
// Set the scrolled frame's initial child lists
scrolledFrame->SetInitialChildList(kPrincipalList, childItems);
- return NS_OK;
}
nsIFrame*
nsCSSFrameConstructor::ConstructFieldSetFrame(nsFrameConstructorState& aState,
FrameConstructionItem& aItem,
nsContainerFrame* aParentFrame,
const nsStyleDisplay* aStyleDisplay,
nsFrameItems& aFrameItems)
@@ -4085,30 +4084,32 @@ nsCSSFrameConstructor::ConstructFrameFro
!(bits & FCDATA_SKIP_FRAMESET)) {
aItem.mContent->SetPrimaryFrame(primaryFrame);
ActiveLayerTracker::TransferActivityToFrame(aItem.mContent, primaryFrame);
}
}
// after the node has been constructed and initialized create any
// anonymous content a node needs.
-nsresult
+void
nsCSSFrameConstructor::CreateAnonymousFrames(nsFrameConstructorState& aState,
nsIContent* aParent,
nsContainerFrame* aParentFrame,
PendingBinding* aPendingBinding,
nsFrameItems& aChildItems)
{
AutoTArray<nsIAnonymousContentCreator::ContentInfo, 4> newAnonymousItems;
nsresult rv = GetAnonymousContent(aParent, aParentFrame, newAnonymousItems);
- NS_ENSURE_SUCCESS(rv, rv);
+ if (NS_WARN_IF(NS_FAILED(rv))) {
+ return;
+ }
uint32_t count = newAnonymousItems.Length();
if (count == 0) {
- return NS_OK;
+ return;
}
nsFrameConstructorState::PendingBindingAutoPusher pusher(aState,
aPendingBinding);
TreeMatchContext::AutoAncestorPusher ancestorPusher(aState.mTreeMatchContext);
if (aState.mTreeMatchContext.mAncestorFilter.HasFilter()) {
ancestorPusher.PushAncestorAndStyleScope(aParent->AsElement());
} else {
@@ -4143,18 +4144,16 @@ nsCSSFrameConstructor::CreateAnonymousFr
TreeMatchContext::AutoParentDisplayBasedStyleFixupSkipper
parentDisplayBasedStyleFixupSkipper(aState.mTreeMatchContext);
AddFrameConstructionItems(aState, content, true, insertion, items);
}
ConstructFramesFromItemList(aState, items, aParentFrame, aChildItems);
}
}
-
- return NS_OK;
}
static void
SetFlagsOnSubtree(nsIContent *aNode, uintptr_t aFlagsToSet)
{
#ifdef DEBUG
// Make sure that the node passed to us doesn't have any XBL children
{
@@ -6105,26 +6104,24 @@ nsCSSFrameConstructor::ConstructFramesFr
inline bool
IsRootBoxFrame(nsIFrame *aFrame)
{
return (aFrame->GetType() == nsGkAtoms::rootFrame);
}
-nsresult
+void
nsCSSFrameConstructor::ReconstructDocElementHierarchy()
{
Element* rootElement = mDocument->GetRootElement();
- if (!rootElement) {
- /* nothing to do */
- return NS_OK;
- }
- return RecreateFramesForContent(rootElement, false, REMOVE_FOR_RECONSTRUCTION,
- nullptr);
+ if (rootElement) {
+ RecreateFramesForContent(rootElement, false, REMOVE_FOR_RECONSTRUCTION,
+ nullptr);
+ }
}
nsContainerFrame*
nsCSSFrameConstructor::GetAbsoluteContainingBlock(nsIFrame* aFrame,
ContainingBlockType aType)
{
// Starting with aFrame, look for a frame that is absolutely positioned or
// relatively positioned (and transformed, if aType is FIXED)
@@ -6364,17 +6361,17 @@ GetInsertNextSibling(nsIFrame* aParentFr
return aParentFrame->PrincipalChildList().FirstChild();
}
/**
* This function is called by ContentAppended() and ContentInserted() when
* appending flowed frames to a parent's principal child list. It handles the
* case where the parent is the trailing inline of an {ib} split.
*/
-nsresult
+void
nsCSSFrameConstructor::AppendFramesToParent(nsFrameConstructorState& aState,
nsContainerFrame* aParentFrame,
nsFrameItems& aFrameList,
nsIFrame* aPrevSibling,
bool aIsRecursiveCall)
{
NS_PRECONDITION(!IsFramePartOfIBSplit(aParentFrame) ||
!GetIBSplitSibling(aParentFrame) ||
@@ -6450,22 +6447,22 @@ nsCSSFrameConstructor::AppendFramesToPar
nsIPresShell::eTreeChange,
NS_FRAME_HAS_DIRTY_CHILDREN);
// Recurse so we create new ib siblings as needed for aParentFrame's parent
return AppendFramesToParent(aState, aParentFrame->GetParent(), ibSiblings,
aParentFrame, true);
}
- return NS_OK;
+ return;
}
// Insert the frames after our aPrevSibling
InsertFrames(aParentFrame, kPrincipalList, aPrevSibling, aFrameList);
- return NS_OK;
+ return;
}
#define UNSET_DISPLAY 255
// This gets called to see if the frames corresponding to aSibling and aContent
// should be siblings in the frame tree. Although (1) rows and cols, (2) row
// groups and col groups, (3) row groups and captions, (4) legends and content
// inside fieldsets, (5) popups and other kids of the menu are siblings from a
@@ -7196,17 +7193,17 @@ nsCSSFrameConstructor::MaybeRecreateForF
REMOVE_FOR_RECONSTRUCTION, nullptr);
return true;
}
}
}
return false;
}
-nsresult
+void
nsCSSFrameConstructor::ContentAppended(nsIContent* aContainer,
nsIContent* aFirstNewContent,
bool aAllowLazyConstruction)
{
AUTO_LAYOUT_PHASE_ENTRY_POINT(mPresShell->GetPresContext(), FrameC);
NS_PRECONDITION(mUpdateCount != 0,
"Should be in an update while creating frames");
@@ -7239,77 +7236,77 @@ nsCSSFrameConstructor::ContentAppended(n
int32_t namespaceID;
nsIAtom* tag =
mDocument->BindingManager()->ResolveTag(aContainer, &namespaceID);
// Just ignore tree tags, anyway we don't create any frames for them.
if (tag == nsGkAtoms::treechildren ||
tag == nsGkAtoms::treeitem ||
tag == nsGkAtoms::treerow)
- return NS_OK;
+ return;
}
#endif // MOZ_XUL
if (aContainer && aContainer->HasFlag(NODE_IS_IN_SHADOW_TREE) &&
!aContainer->IsInNativeAnonymousSubtree() &&
!aFirstNewContent->IsInNativeAnonymousSubtree()) {
// Recreate frames if content is appended into a ShadowRoot
// because children of ShadowRoot are rendered in place of children
// of the host.
//XXXsmaug This is super unefficient!
nsIContent* bindingParent = aContainer->GetBindingParent();
LAYOUT_PHASE_TEMP_EXIT();
- nsresult rv = RecreateFramesForContent(bindingParent, false,
- REMOVE_FOR_RECONSTRUCTION, nullptr);
+ RecreateFramesForContent(bindingParent, false,
+ REMOVE_FOR_RECONSTRUCTION, nullptr);
LAYOUT_PHASE_TEMP_REENTER();
- return rv;
+ return;
}
// See comment in ContentRangeInserted for why this is necessary.
if (!GetContentInsertionFrameFor(aContainer) &&
!aContainer->IsActiveChildrenElement()) {
- return NS_OK;
+ return;
}
if (aAllowLazyConstruction &&
MaybeConstructLazily(CONTENTAPPEND, aContainer, aFirstNewContent)) {
- return NS_OK;
+ return;
}
LAYOUT_PHASE_TEMP_EXIT();
InsertionPoint insertion =
GetRangeInsertionPoint(aContainer, aFirstNewContent, nullptr,
aAllowLazyConstruction);
nsContainerFrame*& parentFrame = insertion.mParentFrame;
LAYOUT_PHASE_TEMP_REENTER();
if (!parentFrame) {
- return NS_OK;
+ return;
}
LAYOUT_PHASE_TEMP_EXIT();
if (MaybeRecreateForFrameset(parentFrame, aFirstNewContent, nullptr)) {
LAYOUT_PHASE_TEMP_REENTER();
- return NS_OK;
+ return;
}
LAYOUT_PHASE_TEMP_REENTER();
if (parentFrame->IsLeaf()) {
// Nothing to do here; we shouldn't be constructing kids of leaves
// Clear lazy bits so we don't try to construct again.
ClearLazyBits(aFirstNewContent, nullptr);
- return NS_OK;
+ return;
}
if (parentFrame->IsFrameOfType(nsIFrame::eMathML)) {
LAYOUT_PHASE_TEMP_EXIT();
- nsresult rv = RecreateFramesForContent(parentFrame->GetContent(), false,
- REMOVE_FOR_RECONSTRUCTION, nullptr);
+ RecreateFramesForContent(parentFrame->GetContent(), false,
+ REMOVE_FOR_RECONSTRUCTION, nullptr);
LAYOUT_PHASE_TEMP_REENTER();
- return rv;
+ return;
}
// If the frame we are manipulating is a ib-split frame (that is, one
// that's been created as a result of a block-in-inline situation) then we
// need to append to the last ib-split sibling, not to the frame itself.
bool parentIBSplit = IsFramePartOfIBSplit(parentFrame);
if (parentIBSplit) {
#ifdef DEBUG
@@ -7397,17 +7394,17 @@ nsCSSFrameConstructor::ContentAppended(n
// Perform special check for diddling around with the frames in
// a ib-split inline frame.
// If we're appending before :after content, then we're not really
// appending, so let WipeContainingBlock know that.
LAYOUT_PHASE_TEMP_EXIT();
if (WipeContainingBlock(state, containingBlock, parentFrame, items,
true, prevSibling)) {
LAYOUT_PHASE_TEMP_REENTER();
- return NS_OK;
+ return;
}
LAYOUT_PHASE_TEMP_REENTER();
// If the parent is a block frame, and we're not in a special case
// where frames can be moved around, determine if the list is for the
// start or end of the block.
if (nsLayoutUtils::GetAsBlock(parentFrame) && !haveFirstLetterStyle &&
!haveFirstLineStyle && !parentIBSplit) {
@@ -7483,18 +7480,16 @@ nsCSSFrameConstructor::ContentAppended(n
#ifdef ACCESSIBILITY
nsAccessibilityService* accService = nsIPresShell::AccService();
if (accService) {
accService->ContentRangeInserted(mPresShell, aContainer,
aFirstNewContent, nullptr);
}
#endif
-
- return NS_OK;
}
#ifdef MOZ_XUL
enum content_operation
{
CONTENT_INSERTED,
CONTENT_REMOVED
@@ -7527,27 +7522,27 @@ bool NotifyListBoxBody(nsPresContext*
return true;
}
}
return false;
}
#endif // MOZ_XUL
-nsresult
+void
nsCSSFrameConstructor::ContentInserted(nsIContent* aContainer,
nsIContent* aChild,
nsILayoutHistoryState* aFrameState,
bool aAllowLazyConstruction)
{
- return ContentRangeInserted(aContainer,
- aChild,
- aChild->GetNextSibling(),
- aFrameState,
- aAllowLazyConstruction);
+ ContentRangeInserted(aContainer,
+ aChild,
+ aChild->GetNextSibling(),
+ aFrameState,
+ aAllowLazyConstruction);
}
// ContentRangeInserted handles creating frames for a range of nodes that
// aren't at the end of their childlist. ContentRangeInserted isn't a real
// content notification, but rather it handles regular ContentInserted calls
// for a single node as well as the lazy construction of frames for a range of
// nodes when called from CreateNeededFrames. For a range of nodes to be
// suitable to have its frames constructed all at once they must meet the same
@@ -7558,17 +7553,17 @@ nsCSSFrameConstructor::ContentInserted(n
// pass the first node in the range to GetInsertionPrevSibling, and if
// IsValidSibling (the only place GetInsertionPrevSibling might look at the
// passed in node itself) needs to resolve style on the node we record this and
// return that this range needs to be split up and inserted separately. Table
// captions need extra attention as we need to determine where to insert them
// in the caption list, while skipping any nodes in the range being inserted
// (because when we treat the caption frames the other nodes have had their
// frames constructed but not yet inserted into the frame tree).
-nsresult
+void
nsCSSFrameConstructor::ContentRangeInserted(nsIContent* aContainer,
nsIContent* aStartChild,
nsIContent* aEndChild,
nsILayoutHistoryState* aFrameState,
bool aAllowLazyConstruction)
{
AUTO_LAYOUT_PHASE_ENTRY_POINT(mPresShell->GetPresContext(), FrameC);
NS_PRECONDITION(mUpdateCount != 0,
@@ -7615,41 +7610,41 @@ nsCSSFrameConstructor::ContentRangeInser
#ifdef MOZ_XUL
if (aContainer && IsXULListBox(aContainer)) {
if (isSingleInsert) {
if (NotifyListBoxBody(mPresShell->GetPresContext(), aContainer,
// The insert case in NotifyListBoxBody
// doesn't use "old next sibling".
aStartChild, nullptr, nullptr, CONTENT_INSERTED)) {
- return NS_OK;
+ return;
}
} else {
// We don't handle a range insert to a listbox parent, issue single
// ContertInserted calls for each node inserted.
LAYOUT_PHASE_TEMP_EXIT();
IssueSingleInsertNofications(aContainer, aStartChild, aEndChild,
aAllowLazyConstruction);
LAYOUT_PHASE_TEMP_REENTER();
- return NS_OK;
+ return;
}
}
#endif // MOZ_XUL
// If we have a null parent, then this must be the document element being
// inserted, or some other child of the document in the DOM (might be a PI,
// say).
if (! aContainer) {
NS_ASSERTION(isSingleInsert,
"root node insertion should be a single insertion");
Element *docElement = mDocument->GetRootElement();
if (aStartChild != docElement) {
// Not the root element; just bail out
- return NS_OK;
+ return;
}
NS_PRECONDITION(nullptr == mRootElementFrame,
"root element frame already created");
// Create frames for the document element and its child elements
nsIFrame* docElementFrame =
ConstructDocElementFrame(docElement, aFrameState);
@@ -7676,53 +7671,53 @@ nsCSSFrameConstructor::ContentRangeInser
#ifdef ACCESSIBILITY
nsAccessibilityService* accService = nsIPresShell::AccService();
if (accService) {
accService->ContentRangeInserted(mPresShell, aContainer,
aStartChild, aEndChild);
}
#endif
- return NS_OK;
+ return;
}
if (aContainer->HasFlag(NODE_IS_IN_SHADOW_TREE) &&
!aContainer->IsInNativeAnonymousSubtree() &&
(!aStartChild || !aStartChild->IsInNativeAnonymousSubtree()) &&
(!aEndChild || !aEndChild->IsInNativeAnonymousSubtree())) {
// Recreate frames if content is inserted into a ShadowRoot
// because children of ShadowRoot are rendered in place of
// the children of the host.
//XXXsmaug This is super unefficient!
nsIContent* bindingParent = aContainer->GetBindingParent();
LAYOUT_PHASE_TEMP_EXIT();
- nsresult rv = RecreateFramesForContent(bindingParent, false,
- REMOVE_FOR_RECONSTRUCTION, nullptr);
+ RecreateFramesForContent(bindingParent, false,
+ REMOVE_FOR_RECONSTRUCTION, nullptr);
LAYOUT_PHASE_TEMP_REENTER();
- return rv;
+ return;
}
// Put 'parentFrame' inside a scope so we don't confuse it with
// 'insertion.mParentFrame' later.
{
nsContainerFrame* parentFrame = GetContentInsertionFrameFor(aContainer);
// The xbl:children element won't have a frame, but default content can have the children as
// a parent. While its uncommon to change the structure of the default content itself, a label,
// for example, can be reframed by having its value attribute set or removed.
if (!parentFrame && !aContainer->IsActiveChildrenElement()) {
- return NS_OK;
+ return;
}
// Otherwise, we've got parent content. Find its frame.
NS_ASSERTION(!parentFrame || parentFrame->GetContent() == aContainer ||
GetDisplayContentsStyleFor(aContainer), "New XBL code is possibly wrong!");
if (aAllowLazyConstruction &&
MaybeConstructLazily(CONTENTINSERT, aContainer, aStartChild)) {
- return NS_OK;
+ return;
}
}
InsertionPoint insertion;
if (isSingleInsert) {
// See if we have an XBL insertion point. If so, then that's our
// real parent frame; if not, then the frame hasn't been built yet
// and we just bail.
@@ -7732,91 +7727,90 @@ nsCSSFrameConstructor::ContentRangeInser
// GetRangeInsertionPoint will take care of that for us.
LAYOUT_PHASE_TEMP_EXIT();
insertion = GetRangeInsertionPoint(aContainer, aStartChild, aEndChild,
aAllowLazyConstruction);
LAYOUT_PHASE_TEMP_REENTER();
}
if (!insertion.mParentFrame) {
- return NS_OK;
+ return;
}
bool isAppend, isRangeInsertSafe;
nsIFrame* prevSibling = GetInsertionPrevSibling(&insertion, aStartChild,
&isAppend, &isRangeInsertSafe);
// check if range insert is safe
if (!isSingleInsert && !isRangeInsertSafe) {
// must fall back to a single ContertInserted for each child in the range
LAYOUT_PHASE_TEMP_EXIT();
IssueSingleInsertNofications(aContainer, aStartChild, aEndChild,
aAllowLazyConstruction);
LAYOUT_PHASE_TEMP_REENTER();
- return NS_OK;
+ return;
}
nsIContent* container = insertion.mParentFrame->GetContent();
nsIAtom* frameType = insertion.mParentFrame->GetType();
LAYOUT_PHASE_TEMP_EXIT();
if (MaybeRecreateForFrameset(insertion.mParentFrame, aStartChild, aEndChild)) {
LAYOUT_PHASE_TEMP_REENTER();
- return NS_OK;
+ return;
}
LAYOUT_PHASE_TEMP_REENTER();
// We should only get here with fieldsets when doing a single insert, because
// fieldsets have multiple insertion points.
NS_ASSERTION(isSingleInsert || frameType != nsGkAtoms::fieldSetFrame,
"Unexpected parent");
if (IsFrameForFieldSet(insertion.mParentFrame, frameType) &&
aStartChild->NodeInfo()->NameAtom() == nsGkAtoms::legend) {
// Just reframe the parent, since figuring out whether this
// should be the new legend and then handling it is too complex.
// We could do a little better here --- check if the fieldset already
// has a legend which occurs earlier in its child list than this node,
// and if so, proceed. But we'd have to extend nsFieldSetFrame
// to locate this legend in the inserted frames and extract it.
LAYOUT_PHASE_TEMP_EXIT();
- nsresult rv = RecreateFramesForContent(insertion.mParentFrame->GetContent(), false,
- REMOVE_FOR_RECONSTRUCTION, nullptr);
+ RecreateFramesForContent(insertion.mParentFrame->GetContent(), false,
+ REMOVE_FOR_RECONSTRUCTION, nullptr);
LAYOUT_PHASE_TEMP_REENTER();
- return rv;
+ return;
}
// We should only get here with details when doing a single insertion because
// we treat details frame as if it has multiple insertion points.
MOZ_ASSERT(isSingleInsert || frameType != nsGkAtoms::detailsFrame);
if (frameType == nsGkAtoms::detailsFrame) {
// When inserting an element into <details>, just reframe the details frame
// and let it figure out where the element should be laid out. It might seem
// expensive to recreate the entire details frame, but it's the simplest way
// to handle the insertion.
LAYOUT_PHASE_TEMP_EXIT();
- nsresult rv =
- RecreateFramesForContent(insertion.mParentFrame->GetContent(), false,
- REMOVE_FOR_RECONSTRUCTION, nullptr);
+ RecreateFramesForContent(insertion.mParentFrame->GetContent(), false,
+ REMOVE_FOR_RECONSTRUCTION, nullptr);
LAYOUT_PHASE_TEMP_REENTER();
- return rv;
+ return;
}
// Don't construct kids of leaves
if (insertion.mParentFrame->IsLeaf()) {
// Clear lazy bits so we don't try to construct again.
ClearLazyBits(aStartChild, aEndChild);
- return NS_OK;
+ return;
}
if (insertion.mParentFrame->IsFrameOfType(nsIFrame::eMathML)) {
LAYOUT_PHASE_TEMP_EXIT();
- nsresult rv = RecreateFramesForContent(insertion.mParentFrame->GetContent(), false,
- REMOVE_FOR_RECONSTRUCTION, nullptr);
+ RecreateFramesForContent(insertion.mParentFrame->GetContent(), false,
+ REMOVE_FOR_RECONSTRUCTION, nullptr);
LAYOUT_PHASE_TEMP_REENTER();
- return rv;
+ return;
}
nsFrameConstructorState state(mPresShell,
GetAbsoluteContainingBlock(insertion.mParentFrame, FIXED_POS),
GetAbsoluteContainingBlock(insertion.mParentFrame, ABS_POS),
GetFloatContainingBlock(insertion.mParentFrame),
do_AddRef(aFrameState));
state.mTreeMatchContext.InitAncestors(aContainer ?
@@ -7883,17 +7877,17 @@ nsCSSFrameConstructor::ContentRangeInser
// Need to recover the letter frames first.
RecoverLetterFrames(state.mFloatedItems.containingBlock);
// must fall back to a single ContertInserted for each child in the range
LAYOUT_PHASE_TEMP_EXIT();
IssueSingleInsertNofications(aContainer, aStartChild, aEndChild,
aAllowLazyConstruction);
LAYOUT_PHASE_TEMP_REENTER();
- return NS_OK;
+ return;
}
container = insertion.mParentFrame->GetContent();
frameType = insertion.mParentFrame->GetType();
}
}
if (!prevSibling) {
@@ -7951,17 +7945,17 @@ nsCSSFrameConstructor::ContentRangeInser
// Perform special check for diddling around with the frames in
// a special inline frame.
// If we're appending before :after content, then we're not really
// appending, so let WipeContainingBlock know that.
LAYOUT_PHASE_TEMP_EXIT();
if (WipeContainingBlock(state, containingBlock, insertion.mParentFrame, items,
isAppend, prevSibling)) {
LAYOUT_PHASE_TEMP_REENTER();
- return NS_OK;
+ return;
}
LAYOUT_PHASE_TEMP_REENTER();
// If the container is a table and a caption will be appended, it needs to be
// put in the table wrapper frame's additional child list.
// We make no attempt here to set flags to indicate whether the list
// will be at the start or end of a block. It doesn't seem worthwhile.
nsFrameItems frameItems, captionItems;
@@ -8123,20 +8117,20 @@ nsCSSFrameConstructor::ContentRangeInser
#ifdef ACCESSIBILITY
nsAccessibilityService* accService = nsIPresShell::AccService();
if (accService) {
accService->ContentRangeInserted(mPresShell, aContainer,
aStartChild, aEndChild);
}
#endif
- return NS_OK;
-}
-
-nsresult
+ return;
+}
+
+void
nsCSSFrameConstructor::ContentRemoved(nsIContent* aContainer,
nsIContent* aChild,
nsIContent* aOldNextSibling,
RemoveFlags aFlags,
bool* aDidReconstruct,
nsIContent** aDestroyedFramesFor)
{
AUTO_LAYOUT_PHASE_ENTRY_POINT(mPresShell->GetPresContext(), FrameC);
@@ -8166,17 +8160,16 @@ nsCSSFrameConstructor::ContentRemoved(ns
static_cast<void*>(aChild),
static_cast<void*>(aOldNextSibling));
if (gReallyNoisyContentUpdates) {
aContainer->List(stdout, 0);
}
}
#endif
- nsresult rv = NS_OK;
nsIFrame* childFrame = aChild->GetPrimaryFrame();
if (!childFrame || childFrame->GetContent() != aChild) {
// XXXbz the GetContent() != aChild check is needed due to bug 135040.
// Remove it once that's fixed.
ClearUndisplayedContentIn(aChild, aContainer);
}
MOZ_ASSERT(!childFrame || !GetDisplayContentsStyleFor(aChild),
"display:contents nodes shouldn't have a frame");
@@ -8193,43 +8186,42 @@ nsCSSFrameConstructor::ContentRemoved(ns
nsTArray<nsIContent*>* generated = ancestorFrame->GetGenConPseudos();
if (generated) {
*aDidReconstruct = true;
LAYOUT_PHASE_TEMP_EXIT();
// XXXmats Can we recreate frames only for the ::after/::before content?
// XXX Perhaps even only those that belong to the aChild sub-tree?
RecreateFramesForContent(ancestor, false, aFlags, aDestroyedFramesFor);
LAYOUT_PHASE_TEMP_REENTER();
- return NS_OK;
+ return;
}
}
FlattenedChildIterator iter(aChild);
for (nsIContent* c = iter.GetNextChild(); c; c = iter.GetNextChild()) {
if (c->GetPrimaryFrame() || GetDisplayContentsStyleFor(c)) {
LAYOUT_PHASE_TEMP_EXIT();
- rv = ContentRemoved(aChild, c, nullptr, aFlags, aDidReconstruct, aDestroyedFramesFor);
+ ContentRemoved(aChild, c, nullptr, aFlags, aDidReconstruct, aDestroyedFramesFor);
LAYOUT_PHASE_TEMP_REENTER();
- NS_ENSURE_SUCCESS(rv, rv);
if (aFlags != REMOVE_DESTROY_FRAMES && *aDidReconstruct) {
- return rv;
+ return;
}
}
}
ClearDisplayContentsIn(aChild, aContainer);
}
nsPresContext* presContext = mPresShell->GetPresContext();
#ifdef MOZ_XUL
if (NotifyListBoxBody(presContext, aContainer, aChild, aOldNextSibling,
childFrame, CONTENT_REMOVED)) {
if (aFlags == REMOVE_DESTROY_FRAMES) {
CaptureStateForFramesOf(aChild, mTempFrameTreeState);
}
- return NS_OK;
+ return;
}
#endif // MOZ_XUL
// If we're removing the root, then make sure to remove things starting at
// the viewport's child instead of the primary frame (which might even be
// null if the root had an XBL binding or display:none, even though the
// frames above it got created). We do the adjustment after the childFrame
@@ -8257,87 +8249,87 @@ nsCSSFrameConstructor::ContentRemoved(ns
!aChild->IsInNativeAnonymousSubtree()) {
// Recreate frames if content is removed from a ShadowRoot
// because it may contain an insertion point which can change
// how the host is rendered.
//XXXsmaug This is super unefficient!
nsIContent* bindingParent = aContainer->GetBindingParent();
*aDidReconstruct = true;
LAYOUT_PHASE_TEMP_EXIT();
- nsresult rv = RecreateFramesForContent(bindingParent, false,
- aFlags, aDestroyedFramesFor);
+ RecreateFramesForContent(bindingParent, false,
+ aFlags, aDestroyedFramesFor);
LAYOUT_PHASE_TEMP_REENTER();
- return rv;
+ return;
}
if (aFlags == REMOVE_DESTROY_FRAMES) {
CaptureStateForFramesOf(aChild, mTempFrameTreeState);
}
if (childFrame) {
InvalidateCanvasIfNeeded(mPresShell, aChild);
// See whether we need to remove more than just childFrame
LAYOUT_PHASE_TEMP_EXIT();
nsIContent* container;
- if (MaybeRecreateContainerForFrameRemoval(childFrame, aFlags, &rv, &container)) {
+ if (MaybeRecreateContainerForFrameRemoval(childFrame, aFlags, &container)) {
LAYOUT_PHASE_TEMP_REENTER();
MOZ_ASSERT(container);
*aDidReconstruct = true;
if (aDestroyedFramesFor) {
*aDestroyedFramesFor = container;
}
- return rv;
+ return;
}
LAYOUT_PHASE_TEMP_REENTER();
// Get the childFrame's parent frame
nsIFrame* parentFrame = childFrame->GetParent();
nsIAtom* parentType = parentFrame->GetType();
if (parentType == nsGkAtoms::frameSetFrame &&
IsSpecialFramesetChild(aChild)) {
// Just reframe the parent, since framesets are weird like that.
*aDidReconstruct = true;
LAYOUT_PHASE_TEMP_EXIT();
- nsresult rv = RecreateFramesForContent(parentFrame->GetContent(), false,
- aFlags, aDestroyedFramesFor);
+ RecreateFramesForContent(parentFrame->GetContent(), false,
+ aFlags, aDestroyedFramesFor);
LAYOUT_PHASE_TEMP_REENTER();
- return rv;
+ return;
}
// If we're a child of MathML, then we should reframe the MathML content.
// If we're non-MathML, then we would be wrapped in a block so we need to
// check our grandparent in that case.
nsIFrame* possibleMathMLAncestor = parentType == nsGkAtoms::blockFrame ?
parentFrame->GetParent() : parentFrame;
if (possibleMathMLAncestor->IsFrameOfType(nsIFrame::eMathML)) {
*aDidReconstruct = true;
LAYOUT_PHASE_TEMP_EXIT();
- nsresult rv = RecreateFramesForContent(possibleMathMLAncestor->GetContent(),
- false, aFlags, aDestroyedFramesFor);
+ RecreateFramesForContent(possibleMathMLAncestor->GetContent(),
+ false, aFlags, aDestroyedFramesFor);
LAYOUT_PHASE_TEMP_REENTER();
- return rv;
+ return;
}
// Undo XUL wrapping if it's no longer needed.
// (If we're in the XUL block-wrapping situation, parentFrame is the
// wrapper frame.)
nsIFrame* grandparentFrame = parentFrame->GetParent();
if (grandparentFrame && grandparentFrame->IsXULBoxFrame() &&
(grandparentFrame->GetStateBits() & NS_STATE_BOX_WRAPS_KIDS_IN_BLOCK) &&
// check if this frame is the only one needing wrapping
aChild == AnyKidsNeedBlockParent(parentFrame->PrincipalChildList().FirstChild()) &&
!AnyKidsNeedBlockParent(childFrame->GetNextSibling())) {
*aDidReconstruct = true;
LAYOUT_PHASE_TEMP_EXIT();
- nsresult rv = RecreateFramesForContent(grandparentFrame->GetContent(), true,
- aFlags, aDestroyedFramesFor);
+ RecreateFramesForContent(grandparentFrame->GetContent(), true,
+ aFlags, aDestroyedFramesFor);
LAYOUT_PHASE_TEMP_REENTER();
- return rv;
+ return;
}
#ifdef ACCESSIBILITY
nsAccessibilityService* accService = nsIPresShell::AccService();
if (accService) {
accService->ContentRemoved(mPresShell, aChild);
}
#endif
@@ -8371,17 +8363,17 @@ nsCSSFrameConstructor::ContentRemoved(ns
RemoveLetterFrames(mPresShell, containingBlock);
// Recover childFrame and parentFrame
childFrame = aChild->GetPrimaryFrame();
if (!childFrame || childFrame->GetContent() != aChild) {
// XXXbz the GetContent() != aChild check is needed due to bug 135040.
// Remove it once that's fixed.
ClearUndisplayedContentIn(aChild, aContainer);
- return NS_OK;
+ return;
}
parentFrame = childFrame->GetParent();
parentType = parentFrame->GetType();
#ifdef NOISY_FIRST_LETTER
printf(" ==> revised parentFrame=");
nsFrame::ListTag(stdout, parentFrame);
printf(" childFrame=");
@@ -8460,18 +8452,16 @@ nsCSSFrameConstructor::ContentRemoved(ns
#ifdef DEBUG
if (gReallyNoisyContentUpdates && parentFrame) {
printf("nsCSSFrameConstructor::ContentRemoved: resulting frame model:\n");
parentFrame->List(stdout, 0);
}
#endif
}
-
- return rv;
}
/**
* This method invalidates the canvas when frames are removed or added for a
* node that might have its background propagated to the canvas, i.e., a
* document root node or an HTML BODY which is a child of the root node.
*
* @param aFrame a frame for a content node about to be removed or a frame that
@@ -8523,37 +8513,36 @@ nsCSSFrameConstructor::EnsureFrameForTex
nsAutoScriptBlocker blocker;
BeginUpdate();
ReconstructDocElementHierarchy();
EndUpdate();
}
return aContent->GetPrimaryFrame();
}
-nsresult
+void
nsCSSFrameConstructor::CharacterDataChanged(nsIContent* aContent,
CharacterDataChangeInfo* aInfo)
{
AUTO_LAYOUT_PHASE_ENTRY_POINT(mPresShell->GetPresContext(), FrameC);
- nsresult rv = NS_OK;
if ((aContent->HasFlag(NS_CREATE_FRAME_IF_NON_WHITESPACE) &&
!aContent->TextIsOnlyWhitespace()) ||
(aContent->HasFlag(NS_REFRAME_IF_WHITESPACE) &&
aContent->TextIsOnlyWhitespace())) {
#ifdef DEBUG
nsIFrame* frame = aContent->GetPrimaryFrame();
NS_ASSERTION(!frame || !frame->IsGeneratedContentFrame(),
"Bit should never be set on generated content");
#endif
LAYOUT_PHASE_TEMP_EXIT();
- nsresult rv = RecreateFramesForContent(aContent, false,
- REMOVE_FOR_RECONSTRUCTION, nullptr);
+ RecreateFramesForContent(aContent, false,
+ REMOVE_FOR_RECONSTRUCTION, nullptr);
LAYOUT_PHASE_TEMP_REENTER();
- return rv;
+ return;
}
// Find the child frame
nsIFrame* frame = aContent->GetPrimaryFrame();
// Notify the first frame that maps the content. It will generate a reflow
// command
@@ -8591,18 +8580,16 @@ nsCSSFrameConstructor::CharacterDataChan
}
frame->CharacterDataChanged(aInfo);
if (haveFirstLetterStyle) {
RecoverLetterFrames(block);
}
}
-
- return rv;
}
void
nsCSSFrameConstructor::BeginUpdate() {
NS_ASSERTION(!nsContentUtils::IsSafeToRunScript(),
"Someone forgot a script blocker");
nsRootPresContext* rootPresContext =
@@ -9250,22 +9237,20 @@ FindPreviousNonWhitespaceSibling(nsIFram
f = f->GetPrevSibling();
} while (f && IsWhitespaceFrame(f));
return f;
}
bool
nsCSSFrameConstructor::MaybeRecreateContainerForFrameRemoval(nsIFrame* aFrame,
RemoveFlags aFlags,
- nsresult* aResult,
nsIContent** aDestroyedFramesFor)
{
NS_PRECONDITION(aFrame, "Must have a frame");
NS_PRECONDITION(aFrame->GetParent(), "Frame shouldn't be root");
- NS_PRECONDITION(aResult, "Null out param?");
NS_PRECONDITION(aFrame == aFrame->FirstContinuation(),
"aFrame not the result of GetPrimaryFrame()?");
*aDestroyedFramesFor = nullptr;
if (IsFramePartOfIBSplit(aFrame)) {
// The removal functions can't handle removal of an {ib} split directly; we
// need to rebuild the containing block.
@@ -9273,42 +9258,40 @@ nsCSSFrameConstructor::MaybeRecreateCont
if (gNoisyContentUpdates) {
printf("nsCSSFrameConstructor::MaybeRecreateContainerForFrameRemoval: "
"frame=");
nsFrame::ListTag(stdout, aFrame);
printf(" is ib-split\n");
}
#endif
- *aResult = ReframeContainingBlock(aFrame, aFlags, aDestroyedFramesFor);
return true;
}
nsContainerFrame* insertionFrame = aFrame->GetContentInsertionFrame();
if (insertionFrame && insertionFrame->GetType() == nsGkAtoms::legendFrame &&
aFrame->GetParent()->GetType() == nsGkAtoms::fieldSetFrame) {
// When we remove the legend for a fieldset, we should reframe
// the fieldset to ensure another legend is used, if there is one
- *aResult = RecreateFramesForContent(aFrame->GetParent()->GetContent(), false,
- aFlags, aDestroyedFramesFor);
+ RecreateFramesForContent(aFrame->GetParent()->GetContent(), false,
+ aFlags, aDestroyedFramesFor);
return true;
}
if (insertionFrame &&
aFrame->GetParent()->GetType() == nsGkAtoms::detailsFrame) {
HTMLSummaryElement* summary =
HTMLSummaryElement::FromContent(insertionFrame->GetContent());
if (summary && summary->IsMainSummary()) {
// When removing a summary, we should reframe the parent details frame to
// ensure that another summary is used or the default summary is
// generated.
- *aResult = RecreateFramesForContent(aFrame->GetParent()->GetContent(),
- false, REMOVE_FOR_RECONSTRUCTION,
- aDestroyedFramesFor);
+ RecreateFramesForContent(aFrame->GetParent()->GetContent(), false,
+ REMOVE_FOR_RECONSTRUCTION, aDestroyedFramesFor);
return true;
}
}
// Now check for possibly needing to reconstruct due to a pseudo parent
nsIFrame* inFlowFrame =
(aFrame->GetStateBits() & NS_FRAME_OUT_OF_FLOW) ?
GetPlaceholderFrameFor(aFrame) : aFrame;
@@ -9330,18 +9313,18 @@ nsCSSFrameConstructor::MaybeRecreateCont
// not going to catch cases when we're the first child.
(inFlowFrame->GetType() == nsGkAtoms::tableColGroupFrame &&
parent->GetChildList(nsIFrame::kColGroupList).FirstChild() == inFlowFrame) ||
// Similar if we're a table-caption.
(inFlowFrame->IsTableCaption() &&
parent->GetChildList(nsIFrame::kCaptionList).FirstChild() == inFlowFrame)) {
// We're the first or last frame in the pseudo. Need to reframe.
// Good enough to recreate frames for |parent|'s content
- *aResult = RecreateFramesForContent(parent->GetContent(), true, aFlags,
- aDestroyedFramesFor);
+ RecreateFramesForContent(parent->GetContent(), true, aFlags,
+ aDestroyedFramesFor);
return true;
}
}
// Might need to reconstruct things if this frame's nextSibling is a table
// or ruby pseudo, since removal of this frame might mean that this pseudo
// needs to get merged with the frame's prevSibling if that's also a table
// or ruby pseudo.
@@ -9360,35 +9343,35 @@ nsCSSFrameConstructor::MaybeRecreateCont
"frame=");
nsFrame::ListTag(stdout, aFrame);
printf(" has a table pseudo next sibling of different type and a "
"table pseudo prevsibling\n");
}
#endif
// Good enough to recreate frames for aFrame's parent's content; even if
// aFrame's parent is a pseudo, that'll be the right content node.
- *aResult = RecreateFramesForContent(parent->GetContent(), true, aFlags,
- aDestroyedFramesFor);
+ RecreateFramesForContent(parent->GetContent(), true, aFlags,
+ aDestroyedFramesFor);
return true;
}
}
// Check ruby containers
nsIAtom* parentType = parent->GetType();
if (parentType == nsGkAtoms::rubyFrame ||
RubyUtils::IsRubyContainerBox(parentType)) {
// In ruby containers, pseudo frames may be created from
// whitespaces or even nothing. There are two cases we actually
// need to handle here, but hard to check exactly:
// 1. Status of spaces beside the frame may vary, and related
// frames may be constructed or destroyed accordingly.
// 2. The type of the first child of a ruby frame determines
// whether a pseudo ruby base container should exist.
- *aResult = RecreateFramesForContent(parent->GetContent(), true, aFlags,
- aDestroyedFramesFor);
+ RecreateFramesForContent(parent->GetContent(), true, aFlags,
+ aDestroyedFramesFor);
return true;
}
// Might need to reconstruct things if the removed frame's nextSibling is an
// anonymous flex item. The removed frame might've been what divided two
// runs of inline content into two anonymous flex items, which would now
// need to be merged.
// NOTE: It's fine that we've advanced nextSibling past whitespace (up above);
@@ -9401,18 +9384,18 @@ nsCSSFrameConstructor::MaybeRecreateCont
if (gNoisyContentUpdates) {
printf("nsCSSFrameConstructor::MaybeRecreateContainerForFrameRemoval: "
"frame=");
nsFrame::ListTag(stdout, aFrame);
printf(" has an anonymous flex item as its next sibling\n");
}
#endif // DEBUG
// Recreate frames for the flex container (the removed frame's parent)
- *aResult = RecreateFramesForContent(parent->GetContent(), true, aFlags,
- aDestroyedFramesFor);
+ RecreateFramesForContent(parent->GetContent(), true, aFlags,
+ aDestroyedFramesFor);
return true;
}
// Might need to reconstruct things if the removed frame's nextSibling is
// null and its parent is an anonymous flex item. (This might be the last
// remaining child of that anonymous flex item, which can then go away.)
if (!nextSibling && IsAnonymousFlexOrGridItem(parent)) {
AssertAnonymousFlexOrGridItemParent(parent, parent->GetParent());
@@ -9420,39 +9403,39 @@ nsCSSFrameConstructor::MaybeRecreateCont
if (gNoisyContentUpdates) {
printf("nsCSSFrameConstructor::MaybeRecreateContainerForFrameRemoval: "
"frame=");
nsFrame::ListTag(stdout, aFrame);
printf(" has an anonymous flex item as its parent\n");
}
#endif // DEBUG
// Recreate frames for the flex container (the removed frame's grandparent)
- *aResult = RecreateFramesForContent(parent->GetParent()->GetContent(), true,
- aFlags, aDestroyedFramesFor);
+ RecreateFramesForContent(parent->GetParent()->GetContent(), true,
+ aFlags, aDestroyedFramesFor);
return true;
}
#ifdef MOZ_XUL
if (aFrame->GetType() == nsGkAtoms::popupSetFrame) {
nsIRootBox* rootBox = nsIRootBox::GetRootBox(mPresShell);
if (rootBox && rootBox->GetPopupSetFrame() == aFrame) {
- *aResult = ReconstructDocElementHierarchy();
+ ReconstructDocElementHierarchy();
return true;
}
}
#endif
// Reconstruct if inflowFrame is parent's only child, and parent is, or has,
// a non-fluid continuation, i.e. it was split by bidi resolution
if (!inFlowFrame->GetPrevSibling() &&
!inFlowFrame->GetNextSibling() &&
((parent->GetPrevContinuation() && !parent->GetPrevInFlow()) ||
(parent->GetNextContinuation() && !parent->GetNextInFlow()))) {
- *aResult = RecreateFramesForContent(parent->GetContent(), true, aFlags,
- aDestroyedFramesFor);
+ RecreateFramesForContent(parent->GetContent(), true, aFlags,
+ aDestroyedFramesFor);
return true;
}
// We might still need to reconstruct things if the parent of inFlowFrame is
// ib-split, since in that case the removal of aFrame might affect the
// splitting of its parent.
if (!IsFramePartOfIBSplit(parent)) {
return false;
@@ -9478,34 +9461,36 @@ nsCSSFrameConstructor::MaybeRecreateCont
if (gNoisyContentUpdates) {
printf("nsCSSFrameConstructor::MaybeRecreateContainerForFrameRemoval: "
"frame=");
nsFrame::ListTag(stdout, parent);
printf(" is ib-split\n");
}
#endif
- *aResult = ReframeContainingBlock(parent, aFlags, aDestroyedFramesFor);
+ ReframeContainingBlock(parent, aFlags, aDestroyedFramesFor);
return true;
}
-nsresult
+void
nsCSSFrameConstructor::RecreateFramesForContent(nsIContent* aContent,
bool aAsyncInsert,
RemoveFlags aFlags,
nsIContent** aDestroyedFramesFor)
{
NS_PRECONDITION(!aAsyncInsert || aContent->IsElement(),
"Can only insert elements async");
// If there is no document, we don't want to recreate frames for it. (You
// shouldn't generally be giving this method content without a document
// anyway).
// Rebuilding the frame tree can have bad effects, especially if it's the
// frame tree for chrome (see bug 157322).
- NS_ENSURE_TRUE(aContent->GetComposedDoc(), NS_ERROR_FAILURE);
+ if (NS_WARN_IF(!aContent->GetComposedDoc())) {
+ return;
+ }
// Is the frame ib-split? If so, we need to reframe the containing
// block *here*, rather than trying to remove and re-insert the
// content (which would otherwise result in *two* nested reframe
// containing block from ContentRemoved() and ContentInserted(),
// below!). We'd really like to optimize away one of those
// containing block reframes, hence the code here.
@@ -9559,25 +9544,24 @@ nsCSSFrameConstructor::RecreateFramesFor
// with native anonymous content from the editor.
if (parent && parent->IsLeaf() && parentContent &&
parentContent != aContent) {
return RecreateFramesForContent(parentContent, aAsyncInsert, aFlags,
aDestroyedFramesFor);
}
}
- nsresult rv = NS_OK;
nsIContent* container;
- if (frame && MaybeRecreateContainerForFrameRemoval(frame, aFlags, &rv,
+ if (frame && MaybeRecreateContainerForFrameRemoval(frame, aFlags,
&container)) {
MOZ_ASSERT(container);
if (aDestroyedFramesFor) {
*aDestroyedFramesFor = container;
}
- return rv;
+ return;
}
nsINode* containerNode = aContent->GetParentNode();
// XXXbz how can containerNode be null here?
if (containerNode) {
// Before removing the frames associated with the content object,
// ask them to save their state onto a temporary state object.
CaptureStateForFramesOf(aContent, mTempFrameTreeState);
@@ -9587,36 +9571,31 @@ nsCSSFrameConstructor::RecreateFramesFor
nsCOMPtr<nsIContent> container = aContent->GetParent();
// Remove the frames associated with the content object.
bool didReconstruct;
nsIContent* nextSibling = aContent->IsRootOfAnonymousSubtree() ?
nullptr : aContent->GetNextSibling();
const bool reconstruct = aFlags != REMOVE_DESTROY_FRAMES;
RemoveFlags flags = reconstruct ? REMOVE_FOR_RECONSTRUCTION : aFlags;
- rv = ContentRemoved(container, aContent, nextSibling, flags,
- &didReconstruct, aDestroyedFramesFor);
- if (NS_FAILED(rv)) {
- return rv;
- }
+ ContentRemoved(container, aContent, nextSibling, flags,
+ &didReconstruct, aDestroyedFramesFor);
if (reconstruct && !didReconstruct) {
// Now, recreate the frames associated with this content object. If
// ContentRemoved triggered reconstruction, then we don't need to do this
// because the frames will already have been built.
if (aAsyncInsert) {
// XXXmats doesn't frame state need to be restored in this case too?
RestyleManager()->PostRestyleEvent(
aContent->AsElement(), nsRestyleHint(0), nsChangeHint_ReconstructFrame);
} else {
- rv = ContentInserted(container, aContent, mTempFrameTreeState, false);
- }
- }
- }
-
- return rv;
+ ContentInserted(container, aContent, mTempFrameTreeState, false);
+ }
+ }
+ }
}
void
nsCSSFrameConstructor::DestroyFramesFor(nsIContent* aContent,
nsIContent** aDestroyedFramesFor)
{
MOZ_ASSERT(aContent && aContent->GetParentNode());
@@ -10891,26 +10870,25 @@ nsCSSFrameConstructor::AppendFirstLineFr
nsFirstLineFrame* lineFrame = static_cast<nsFirstLineFrame*>(lastBlockKid);
WrapFramesInFirstLineFrame(aState, aBlockContent, aBlockFrame,
lineFrame, aFrameItems);
}
// Special routine to handle inserting a new frame into a block
// frame's child list. Takes care of placing the new frame into the
// right place when first-line style is present.
-nsresult
+void
nsCSSFrameConstructor::InsertFirstLineFrames(
nsFrameConstructorState& aState,
nsIContent* aContent,
nsIFrame* aBlockFrame,
nsContainerFrame** aParentFrame,
nsIFrame* aPrevSibling,
nsFrameItems& aFrameItems)
{
- nsresult rv = NS_OK;
// XXXbz If you make this method actually do something, check to
// make sure that the caller is passing what you expect. In
// particular, which content is aContent? And audit the rest of
// this code too; it makes bogus assumptions and may not build.
#if 0
nsIFrame* parentFrame = *aParentFrame;
nsIFrame* newFrame = aFrameItems.childList;
bool isInline = IsInlineOutside(newFrame);
@@ -11030,17 +11008,16 @@ nsCSSFrameConstructor::InsertFirstLineFr
aFrameItems.childList = nullptr;
aFrameItems.lastChild = nullptr;
}
}
}
}
#endif
- return rv;
}
//----------------------------------------------------------------------
// First-letter support
// Determine how many characters in the text fragment apply to the
// first letter
@@ -11354,58 +11331,58 @@ FindFirstLetterFrame(nsIFrame* aFrame, n
for (nsFrameList::Enumerator e(list); !e.AtEnd(); e.Next()) {
if (nsGkAtoms::letterFrame == e.get()->GetType()) {
return e.get();
}
}
return nullptr;
}
-nsresult
+void
nsCSSFrameConstructor::RemoveFloatingFirstLetterFrames(
nsIPresShell* aPresShell,
nsIFrame* aBlockFrame)
{
// Look for the first letter frame on the kFloatList, then kPushedFloatsList.
nsIFrame* floatFrame =
::FindFirstLetterFrame(aBlockFrame, nsIFrame::kFloatList);
if (!floatFrame) {
floatFrame =
::FindFirstLetterFrame(aBlockFrame, nsIFrame::kPushedFloatsList);
if (!floatFrame) {
- return NS_OK;
+ return;
}
}
// Take the text frame away from the letter frame (so it isn't
// destroyed when we destroy the letter frame).
nsIFrame* textFrame = floatFrame->PrincipalChildList().FirstChild();
if (!textFrame) {
- return NS_OK;
+ return;
}
// Discover the placeholder frame for the letter frame
nsPlaceholderFrame* placeholderFrame = GetPlaceholderFrameFor(floatFrame);
if (!placeholderFrame) {
// Somethings really wrong
- return NS_OK;
+ return;
}
nsContainerFrame* parentFrame = placeholderFrame->GetParent();
if (!parentFrame) {
// Somethings really wrong
- return NS_OK;
+ return;
}
// Create a new text frame with the right style context that maps
// all of the content that was previously part of the letter frame
// (and probably continued elsewhere).
nsStyleContext* parentSC = parentFrame->StyleContext();
nsIContent* textContent = textFrame->GetContent();
if (!textContent) {
- return NS_OK;
+ return;
}
RefPtr<nsStyleContext> newSC = aPresShell->StyleSet()->
ResolveStyleForText(textContent, parentSC);
nsIFrame* newTextFrame = NS_NewTextFrame(aPresShell, newSC);
newTextFrame->Init(textContent, parentFrame, nullptr);
// Destroy the old text frame's continuations (the old text frame
// will be destroyed when its letter frame is destroyed).
@@ -11440,21 +11417,20 @@ nsCSSFrameConstructor::RemoveFloatingFir
// Insert text frame in its place
nsFrameList textList(newTextFrame, newTextFrame);
InsertFrames(parentFrame, kPrincipalList, prevSibling, textList);
if (offsetsNeedFixing) {
prevSibling->RemoveStateBits(TEXT_OFFSETS_NEED_FIXING);
}
-
- return NS_OK;
-}
-
-nsresult
+}
+
+
+void
nsCSSFrameConstructor::RemoveFirstLetterFrames(nsIPresShell* aPresShell,
nsContainerFrame* aFrame,
nsContainerFrame* aBlockFrame,
bool* aStopLooking)
{
nsIFrame* prevSibling = nullptr;
nsIFrame* kid = aFrame->PrincipalChildList().FirstChild();
@@ -11502,58 +11478,50 @@ nsCSSFrameConstructor::RemoveFirstLetter
prevSibling->RemoveStateBits(TEXT_OFFSETS_NEED_FIXING);
}
*aStopLooking = true;
NS_ASSERTION(!aBlockFrame->GetPrevContinuation(),
"should have the first continuation here");
aBlockFrame->RemoveStateBits(NS_BLOCK_HAS_FIRST_LETTER_CHILD);
break;
- }
- else if (IsInlineFrame(kid)) {
+ } else if (IsInlineFrame(kid)) {
nsContainerFrame* kidAsContainerFrame = do_QueryFrame(kid);
if (kidAsContainerFrame) {
// Look inside child inline frame for the letter frame.
RemoveFirstLetterFrames(aPresShell, kidAsContainerFrame,
aBlockFrame, aStopLooking);
if (*aStopLooking) {
break;
}
}
}
prevSibling = kid;
kid = kid->GetNextSibling();
}
-
- return NS_OK;
-}
-
-nsresult
+}
+
+void
nsCSSFrameConstructor::RemoveLetterFrames(nsIPresShell* aPresShell,
nsContainerFrame* aBlockFrame)
{
aBlockFrame =
static_cast<nsContainerFrame*>(aBlockFrame->FirstContinuation());
nsContainerFrame* continuation = aBlockFrame;
bool stopLooking = false;
- nsresult rv;
do {
- rv = RemoveFloatingFirstLetterFrames(aPresShell, continuation);
- if (NS_SUCCEEDED(rv)) {
- rv = RemoveFirstLetterFrames(aPresShell,
- continuation, aBlockFrame, &stopLooking);
- }
+ RemoveFloatingFirstLetterFrames(aPresShell, continuation);
+ RemoveFirstLetterFrames(aPresShell, continuation, aBlockFrame, &stopLooking);
if (stopLooking) {
break;
}
continuation =
static_cast<nsContainerFrame*>(continuation->GetNextContinuation());
} while (continuation);
- return rv;
}
// Fixup the letter frame situation for the given block
void
nsCSSFrameConstructor::RecoverLetterFrames(nsContainerFrame* aBlockFrame)
{
aBlockFrame =
static_cast<nsContainerFrame*>(aBlockFrame->FirstContinuation());
@@ -11586,26 +11554,24 @@ nsCSSFrameConstructor::RecoverLetterFram
parentFrame->InsertFrames(kPrincipalList, prevFrame, letterFrames);
}
}
//----------------------------------------------------------------------
// listbox Widget Routines
-nsresult
+void
nsCSSFrameConstructor::CreateListBoxContent(nsContainerFrame* aParentFrame,
nsIFrame* aPrevFrame,
nsIContent* aChild,
nsIFrame** aNewFrame,
bool aIsAppend)
{
#ifdef MOZ_XUL
- nsresult rv = NS_OK;
-
// Construct a new frame
if (nullptr != aParentFrame) {
nsFrameItems frameItems;
nsFrameConstructorState state(mPresShell, GetAbsoluteContainingBlock(aParentFrame, FIXED_POS),
GetAbsoluteContainingBlock(aParentFrame, ABS_POS),
GetFloatContainingBlock(aParentFrame),
do_AddRef(mTempFrameTreeState.get()));
@@ -11616,17 +11582,17 @@ nsCSSFrameConstructor::CreateListBoxCont
styleContext = ResolveStyleContext(aParentFrame, aChild, &state);
// Pre-check for display "none" - only if we find that, do we create
// any frame at all
const nsStyleDisplay* display = styleContext->StyleDisplay();
if (NS_STYLE_DISPLAY_NONE == display->mDisplay) {
*aNewFrame = nullptr;
- return NS_OK;
+ return;
}
BeginUpdate();
FrameConstructionItemList items;
AddFrameConstructionItemsInternal(state, aChild, aParentFrame,
aChild->NodeInfo()->NameAtom(),
aChild->GetNameSpaceID(),
@@ -11635,37 +11601,33 @@ nsCSSFrameConstructor::CreateListBoxCont
ConstructFramesFromItemList(state, items, aParentFrame, frameItems);
nsIFrame* newFrame = frameItems.FirstChild();
*aNewFrame = newFrame;
if (newFrame) {
// Notify the parent frame
if (aIsAppend)
- rv = ((nsListBoxBodyFrame*)aParentFrame)->ListBoxAppendFrames(frameItems);
+ ((nsListBoxBodyFrame*)aParentFrame)->ListBoxAppendFrames(frameItems);
else
- rv = ((nsListBoxBodyFrame*)aParentFrame)->ListBoxInsertFrames(aPrevFrame, frameItems);
+ ((nsListBoxBodyFrame*)aParentFrame)->ListBoxInsertFrames(aPrevFrame, frameItems);
}
EndUpdate();
#ifdef ACCESSIBILITY
if (newFrame) {
nsAccessibilityService* accService = nsIPresShell::AccService();
if (accService) {
accService->ContentRangeInserted(mPresShell, aChild->GetParent(),
aChild, aChild->GetNextSibling());
}
}
#endif
}
-
- return rv;
-#else
- return NS_ERROR_FAILURE;
#endif
}
//----------------------------------------
void
nsCSSFrameConstructor::ConstructBlock(nsFrameConstructorState& aState,
nsIContent* aContent,
@@ -12428,17 +12390,17 @@ nsCSSFrameConstructor::WipeContainingBlo
static_cast<void*>(blockContent));
}
#endif
RecreateFramesForContent(blockContent, true, REMOVE_FOR_RECONSTRUCTION,
nullptr);
return true;
}
-nsresult
+void
nsCSSFrameConstructor::ReframeContainingBlock(nsIFrame* aFrame,
RemoveFlags aFlags,
nsIContent** aDestroyedFramesFor)
{
#ifdef DEBUG
// ReframeContainingBlock is a NASTY routine, it causes terrible performance problems
// so I want to see when it is happening! Unfortunately, it is happening way to often because
@@ -12451,17 +12413,17 @@ nsCSSFrameConstructor::ReframeContaining
#endif
// XXXbz how exactly would we get here while isReflowing anyway? Should this
// whole test be ifdef DEBUG?
if (mPresShell->IsReflowLocked()) {
// don't ReframeContainingBlock, this will result in a crash
// if we remove a tree that's in reflow - see bug 121368 for testcase
NS_ERROR("Atemptted to nsCSSFrameConstructor::ReframeContainingBlock during a Reflow!!!");
- return NS_OK;
+ return;
}
// Get the first "normal" ancestor of the target frame.
nsIFrame* containingBlock = GetIBContainingBlockFor(aFrame);
if (containingBlock) {
// From here we look for the containing block in case the target
// frame is already a block (which can happen when an inline frame
// wraps some of its content in an anonymous block; see
@@ -12483,17 +12445,17 @@ nsCSSFrameConstructor::ReframeContaining
}
}
// If we get here, we're screwed!
return RecreateFramesForContent(mPresShell->GetDocument()->GetRootElement(),
true, aFlags, nullptr);
}
-nsresult
+void
nsCSSFrameConstructor::GenerateChildFrames(nsContainerFrame* aFrame)
{
{
nsAutoScriptBlocker scriptBlocker;
BeginUpdate();
nsFrameItems childItems;
nsFrameConstructorState state(mPresShell, nullptr, nullptr, nullptr);
@@ -12517,18 +12479,16 @@ nsCSSFrameConstructor::GenerateChildFram
if (child) {
accService->ContentRangeInserted(mPresShell, container, child, nullptr);
}
}
#endif
// call XBL constructors after the frames are created
mPresShell->GetDocument()->BindingManager()->ProcessAttachedQueue();
-
- return NS_OK;
}
//////////////////////////////////////////////////////////
// nsCSSFrameConstructor::FrameConstructionItem methods //
//////////////////////////////////////////////////////////
bool
nsCSSFrameConstructor::
FrameConstructionItem::IsWhitespace(nsFrameConstructorState& aState) const
--- a/layout/base/nsCSSFrameConstructor.h
+++ b/layout/base/nsCSSFrameConstructor.h
@@ -42,29 +42,30 @@ namespace mozilla {
namespace dom {
class FlattenedChildIterator;
} // namespace dom
} // namespace mozilla
-class nsCSSFrameConstructor : public nsFrameManager
+class nsCSSFrameConstructor final : public nsFrameManager
{
public:
typedef mozilla::CSSPseudoElementType CSSPseudoElementType;
typedef mozilla::dom::Element Element;
friend class mozilla::RestyleManager;
friend class mozilla::RestyleManagerBase;
friend class mozilla::ServoRestyleManager;
nsCSSFrameConstructor(nsIDocument* aDocument, nsIPresShell* aPresShell);
- ~nsCSSFrameConstructor(void) {
- NS_ASSERTION(mUpdateCount == 0, "Dying in the middle of our own update?");
+ ~nsCSSFrameConstructor() {
+ MOZ_ASSERT(mUpdateCount == 0,
+ "Dying in the middle of our own update?");
}
// get the alternate text for a content node
static void GetAlternateTextFor(nsIContent* aContent,
nsIAtom* aTag, // content object's tag
nsXPIDLString& aAltText);
private:
@@ -72,17 +73,17 @@ private:
nsCSSFrameConstructor& operator=(const nsCSSFrameConstructor& aCopy) = delete;
public:
mozilla::RestyleManagerHandle RestyleManager() const
{ return mPresShell->GetPresContext()->RestyleManager(); }
nsIFrame* ConstructRootFrame();
- nsresult ReconstructDocElementHierarchy();
+ void ReconstructDocElementHierarchy();
// Create frames for content nodes that are marked as needing frames. This
// should be called before ProcessPendingRestyles.
// Note: It's the caller's responsibility to make sure to wrap a
// CreateNeededFrames call in a view update batch and a script blocker.
void CreateNeededFrames();
private:
@@ -91,18 +92,18 @@ private:
enum Operation {
CONTENTAPPEND,
CONTENTINSERT
};
// aChild is the child being inserted for inserts, and the first
// child being appended for appends.
bool MaybeConstructLazily(Operation aOperation,
- nsIContent* aContainer,
- nsIContent* aChild);
+ nsIContent* aContainer,
+ nsIContent* aChild);
// Issues a single ContentInserted for each child of aContainer in the range
// [aStartChild, aEndChild).
void IssueSingleInsertNofications(nsIContent* aContainer,
nsIContent* aStartChild,
nsIContent* aEndChild,
bool aAllowLazyConstruction);
@@ -196,38 +197,38 @@ public:
* quicker by processing the content tree from top down the next time we call
* CreateNeededFrames. (We do clear the bits when BindToTree is called on any
* nsIContent; so any nodes added to the document will not have any lazy bits
* set.)
*/
// If aAllowLazyConstruction is true then frame construction of the new
// children can be done lazily.
- nsresult ContentAppended(nsIContent* aContainer,
- nsIContent* aFirstNewContent,
- bool aAllowLazyConstruction);
+ void ContentAppended(nsIContent* aContainer,
+ nsIContent* aFirstNewContent,
+ bool aAllowLazyConstruction);
// If aAllowLazyConstruction is true then frame construction of the new child
// can be done lazily.
- nsresult ContentInserted(nsIContent* aContainer,
- nsIContent* aChild,
- nsILayoutHistoryState* aFrameState,
- bool aAllowLazyConstruction);
+ void ContentInserted(nsIContent* aContainer,
+ nsIContent* aChild,
+ nsILayoutHistoryState* aFrameState,
+ bool aAllowLazyConstruction);
// Like ContentInserted but handles inserting the children of aContainer in
// the range [aStartChild, aEndChild). aStartChild must be non-null.
// aEndChild may be null to indicate the range includes all kids after
// aStartChild. If aAllowLazyConstruction is true then frame construction of
// the new children can be done lazily. It is only allowed to be true when
// inserting a single node.
- nsresult ContentRangeInserted(nsIContent* aContainer,
- nsIContent* aStartChild,
- nsIContent* aEndChild,
- nsILayoutHistoryState* aFrameState,
- bool aAllowLazyConstruction);
+ void ContentRangeInserted(nsIContent* aContainer,
+ nsIContent* aStartChild,
+ nsIContent* aEndChild,
+ nsILayoutHistoryState* aFrameState,
+ bool aAllowLazyConstruction);
enum RemoveFlags {
REMOVE_CONTENT, REMOVE_FOR_RECONSTRUCTION, REMOVE_DESTROY_FRAMES };
/**
* Recreate or destroy frames for aChild in aContainer.
* aFlags == REMOVE_CONTENT means aChild has been removed from the document.
* aFlags == REMOVE_FOR_RECONSTRUCTION means the caller will reconstruct the
* frames later.
@@ -237,35 +238,35 @@ public:
* it. Ancestors may have been reframed though.
* aFlags == REMOVE_DESTROY_FRAMES is the same as REMOVE_FOR_RECONSTRUCTION
* except it will never try to reconstruct frames. Instead, the caller is
* responsible for doing that, on the content returned in aDestroyedFramesFor.
* The layout frame state is guarranted to be captured for the removed frames
* only when aFlags == REMOVE_DESTROY_FRAMES, otherwise it will only be
* captured if we reconstructed frames for an ancestor.
*/
- nsresult ContentRemoved(nsIContent* aContainer,
- nsIContent* aChild,
- nsIContent* aOldNextSibling,
- RemoveFlags aFlags,
- bool* aDidReconstruct,
- nsIContent** aDestroyedFramesFor = nullptr);
+ void ContentRemoved(nsIContent* aContainer,
+ nsIContent* aChild,
+ nsIContent* aOldNextSibling,
+ RemoveFlags aFlags,
+ bool* aDidReconstruct,
+ nsIContent** aDestroyedFramesFor = nullptr);
- nsresult CharacterDataChanged(nsIContent* aContent,
- CharacterDataChangeInfo* aInfo);
+ void CharacterDataChanged(nsIContent* aContent,
+ CharacterDataChangeInfo* aInfo);
// If aContent is a text node that has been optimized away due to being
// whitespace next to a block boundary (or for some other reason), stop
// doing that and create a frame for it if it should have one. This recreates
// frames so be careful (although this should not change actual layout).
// Returns the frame for aContent if there is one.
nsIFrame* EnsureFrameForTextNode(nsGenericDOMDataNode* aContent);
// generate the child frames and process bindings
- nsresult GenerateChildFrames(nsContainerFrame* aFrame);
+ void GenerateChildFrames(nsContainerFrame* aFrame);
// Should be called when a frame is going to be destroyed and
// WillDestroyFrameTree hasn't been called yet.
void NotifyDestroyingFrame(nsIFrame* aFrame);
void BeginUpdate();
void EndUpdate();
void RecalcQuotesAndCounters();
@@ -297,21 +298,21 @@ public:
// Copy over fixed frames from aParentFrame's prev-in-flow
nsresult ReplicateFixedFrames(nsPageContentFrame* aParentFrame);
/**
* Get the XBL insertion point for aChild in aContainer.
*/
InsertionPoint GetInsertionPoint(nsIContent* aContainer, nsIContent* aChild);
- nsresult CreateListBoxContent(nsContainerFrame* aParentFrame,
- nsIFrame* aPrevFrame,
- nsIContent* aChild,
- nsIFrame** aResult,
- bool aIsAppend);
+ void CreateListBoxContent(nsContainerFrame* aParentFrame,
+ nsIFrame* aPrevFrame,
+ nsIContent* aChild,
+ nsIFrame** aResult,
+ bool aIsAppend);
// GetInitialContainingBlock() is deprecated in favor of GetRootElementFrame();
// nsIFrame* GetInitialContainingBlock() { return mRootElementFrame; }
// This returns the outermost frame for the root element
nsContainerFrame* GetRootElementFrame() { return mRootElementFrame; }
// This returns the frame for the root element that does not
// have a psuedo-element style
nsIFrame* GetRootElementStyleFrame() { return mRootElementStyleFrame; }
@@ -412,24 +413,24 @@ private:
* @param aAttrNamespace the namespace of the attribute in question
* @param aAttrName the localname of the attribute
* @param aStyleContext the style context to use
* @param aGeneratedContent the array of generated content to append the
* created content to.
* @param [out] aNewContent the content node we create
* @param [out] aNewFrame the new frame we create
*/
- nsresult CreateAttributeContent(nsIContent* aParentContent,
- nsIFrame* aParentFrame,
- int32_t aAttrNamespace,
- nsIAtom* aAttrName,
- nsStyleContext* aStyleContext,
- nsCOMArray<nsIContent>& aGeneratedContent,
- nsIContent** aNewContent,
- nsIFrame** aNewFrame);
+ void CreateAttributeContent(nsIContent* aParentContent,
+ nsIFrame* aParentFrame,
+ int32_t aAttrNamespace,
+ nsIAtom* aAttrName,
+ nsStyleContext* aStyleContext,
+ nsCOMArray<nsIContent>& aGeneratedContent,
+ nsIContent** aNewContent,
+ nsIFrame** aNewFrame);
/**
* Create a text node containing the given string. If aText is non-null
* then we also set aText to the returned node.
*/
already_AddRefed<nsIContent> CreateGenConTextNode(nsFrameConstructorState& aState,
const nsString& aString,
RefPtr<nsTextNode>* aText,
@@ -457,21 +458,21 @@ private:
CSSPseudoElementType aPseudoElement,
FrameConstructionItemList& aItems);
// This method can change aFrameList: it can chop off the beginning and put
// it in aParentFrame while putting the remainder into a ib-split sibling of
// aParentFrame. aPrevSibling must be the frame after which aFrameList is to
// be placed on aParentFrame's principal child list. It may be null if
// aFrameList is being added at the beginning of the child list.
- nsresult AppendFramesToParent(nsFrameConstructorState& aState,
- nsContainerFrame* aParentFrame,
- nsFrameItems& aFrameList,
- nsIFrame* aPrevSibling,
- bool aIsRecursiveCall = false);
+ void AppendFramesToParent(nsFrameConstructorState& aState,
+ nsContainerFrame* aParentFrame,
+ nsFrameItems& aFrameList,
+ nsIFrame* aPrevSibling,
+ bool aIsRecursiveCall = false);
// BEGIN TABLE SECTION
/**
* Construct a table wrapper frame. This is the FrameConstructionData
* callback used for the job.
*/
nsIFrame* ConstructTable(nsFrameConstructorState& aState,
FrameConstructionItem& aItem,
@@ -1414,21 +1415,21 @@ private:
nsContainerFrame* aParentFrame,
nsFrameItems& aFrameItems);
void ConstructFramesFromItem(nsFrameConstructorState& aState,
FCItemIterator& aItem,
nsContainerFrame* aParentFrame,
nsFrameItems& aFrameItems);
static bool AtLineBoundary(FCItemIterator& aIter);
- nsresult CreateAnonymousFrames(nsFrameConstructorState& aState,
- nsIContent* aParent,
- nsContainerFrame* aParentFrame,
- PendingBinding* aPendingBinding,
- nsFrameItems& aChildItems);
+ void CreateAnonymousFrames(nsFrameConstructorState& aState,
+ nsIContent* aParent,
+ nsContainerFrame* aParentFrame,
+ PendingBinding* aPendingBinding,
+ nsFrameItems& aChildItems);
nsresult GetAnonymousContent(nsIContent* aParent,
nsIFrame* aParentFrame,
nsTArray<nsIAnonymousContentCreator::ContentInfo>& aAnonContent);
//MathML Mod - RBS
/**
* Takes the frames in aBlockItems and wraps them in a new anonymous block
@@ -1647,17 +1648,17 @@ private:
// Creates a view for the scrolledframe and makes it the child of the scrollframe.
void
FinishBuildingScrollFrame(nsContainerFrame* aScrollFrame,
nsIFrame* aScrolledFrame);
// InitializeSelectFrame puts scrollFrame in aFrameItems if aBuildCombobox is false
// aBuildCombobox indicates if we are building a combobox that has a dropdown
// popup widget or not.
- nsresult
+ void
InitializeSelectFrame(nsFrameConstructorState& aState,
nsContainerFrame* aScrollFrame,
nsContainerFrame* aScrolledFrame,
nsIContent* aContent,
nsContainerFrame* aParentFrame,
nsStyleContext* aStyleContext,
bool aBuildCombobox,
PendingBinding* aPendingBinding,
@@ -1676,17 +1677,17 @@ private:
* Recreate frames for aContent.
* @param aContent the content to recreate frames for
* @param aAsyncInsert if true then a restyle event will be posted to handle
* the required ContentInserted call instead of doing it immediately.
* @param aFlags normally you want to pass REMOVE_FOR_RECONSTRUCTION here
* @param aDestroyedFramesFor if non-null, it will contain the content that
* was actually reframed - it may be different than aContent.
*/
- nsresult
+ void
RecreateFramesForContent(nsIContent* aContent,
bool aAsyncInsert,
RemoveFlags aFlags,
nsIContent** aDestroyedFramesFor);
// If removal of aFrame from the frame tree requires reconstruction of some
// containing block (either of aFrame or of its parent) due to {ib} splits or
// table pseudo-frames, recreate the relevant frame subtree. The return value
@@ -1694,17 +1695,16 @@ private:
// the return value of ReframeContainingBlock or RecreateFramesForContent. If
// this method returns false, the value of *aResult is not affected. aFrame
// and aResult must not be null. aFrame must be the result of a
// GetPrimaryFrame() call on a content node (which means its parent is also
// not null). If this method returns true, aDestroyedFramesFor contains the
// content that was reframed.
bool MaybeRecreateContainerForFrameRemoval(nsIFrame* aFrame,
RemoveFlags aFlags,
- nsresult* aResult,
nsIContent** aDestroyedFramesFor);
nsIFrame* CreateContinuingOuterTableFrame(nsIPresShell* aPresShell,
nsPresContext* aPresContext,
nsIFrame* aFrame,
nsContainerFrame* aParentFrame,
nsIContent* aContent,
nsStyleContext* aStyleContext);
@@ -1819,19 +1819,19 @@ private:
// otherwise
bool WipeContainingBlock(nsFrameConstructorState& aState,
nsIFrame* aContainingBlock,
nsIFrame* aFrame,
FrameConstructionItemList& aItems,
bool aIsAppend,
nsIFrame* aPrevSibling);
- nsresult ReframeContainingBlock(nsIFrame* aFrame,
- RemoveFlags aFlags,
- nsIContent** aReframeContent);
+ void ReframeContainingBlock(nsIFrame* aFrame,
+ RemoveFlags aFlags,
+ nsIContent** aReframeContent);
//----------------------------------------
// Methods support :first-letter style
void CreateFloatingLetterFrame(nsFrameConstructorState& aState,
nsIContent* aTextContent,
nsIFrame* aTextFrame,
@@ -1875,28 +1875,28 @@ private:
nsIFrame** aTextFrame,
nsIFrame** aPrevFrame,
nsFrameItems& aLetterFrames,
bool* aStopLooking);
void RecoverLetterFrames(nsContainerFrame* aBlockFrame);
//
- nsresult RemoveLetterFrames(nsIPresShell* aPresShell,
- nsContainerFrame* aBlockFrame);
+ void RemoveLetterFrames(nsIPresShell* aPresShell,
+ nsContainerFrame* aBlockFrame);
// Recursive helper for RemoveLetterFrames
- nsresult RemoveFirstLetterFrames(nsIPresShell* aPresShell,
- nsContainerFrame* aFrame,
- nsContainerFrame* aBlockFrame,
- bool* aStopLooking);
+ void RemoveFirstLetterFrames(nsIPresShell* aPresShell,
+ nsContainerFrame* aFrame,
+ nsContainerFrame* aBlockFrame,
+ bool* aStopLooking);
// Special remove method for those pesky floating first-letter frames
- nsresult RemoveFloatingFirstLetterFrames(nsIPresShell* aPresShell,
- nsIFrame* aBlockFrame);
+ void RemoveFloatingFirstLetterFrames(nsIPresShell* aPresShell,
+ nsIFrame* aBlockFrame);
// Capture state for the frame tree rooted at the frame associated with the
// content object, aContent
void CaptureStateForFramesOf(nsIContent* aContent,
nsILayoutHistoryState* aHistoryState);
//----------------------------------------
@@ -1917,22 +1917,22 @@ private:
// Handle the case when a block with first-line style is appended to (by
// possibly calling WrapFramesInFirstLineFrame as needed).
void AppendFirstLineFrames(nsFrameConstructorState& aState,
nsIContent* aContent,
nsContainerFrame* aBlockFrame,
nsFrameItems& aFrameItems);
- nsresult InsertFirstLineFrames(nsFrameConstructorState& aState,
- nsIContent* aContent,
- nsIFrame* aBlockFrame,
- nsContainerFrame** aParentFrame,
- nsIFrame* aPrevSibling,
- nsFrameItems& aFrameItems);
+ void InsertFirstLineFrames(nsFrameConstructorState& aState,
+ nsIContent* aContent,
+ nsIFrame* aBlockFrame,
+ nsContainerFrame** aParentFrame,
+ nsIFrame* aPrevSibling,
+ nsFrameItems& aFrameItems);
/**
* Find the right frame to use for aContent when looking for sibling
* frames for aTargetContent. If aPrevSibling is true, this
* will look for last continuations, etc, as necessary. This calls
* IsValidSibling as needed; if that returns false it returns null.
*
* @param aContent the content to search for frames