Bug 1606192 - Remove some unused nsresult return value in layout code. r=dbaron

Differential Revision: https://phabricator.services.mozilla.com/D58342

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Xidorn Quan 2019-12-28 03:27:13 +00:00
Родитель 069c444c65
Коммит 3bb05cef1c
6 изменённых файлов: 30 добавлений и 49 удалений

Просмотреть файл

@ -603,9 +603,8 @@ static bool IsBidiLeaf(nsIFrame* aFrame) {
* newly-created continuation of aParent.
* If aFrame is null, all the children of aParent are reparented.
*/
static nsresult SplitInlineAncestors(nsContainerFrame* aParent,
nsLineList::iterator aLine,
nsIFrame* aFrame) {
static void SplitInlineAncestors(nsContainerFrame* aParent,
nsLineList::iterator aLine, nsIFrame* aFrame) {
nsPresContext* presContext = aParent->PresContext();
PresShell* presShell = presContext->PresShell();
nsIFrame* frame = aFrame;
@ -627,11 +626,7 @@ static nsresult SplitInlineAncestors(nsContainerFrame* aParent,
nsFrameList tail = parent->StealFramesAfter(frame);
// Reparent views as necessary
nsresult rv;
rv = nsContainerFrame::ReparentFrameViewList(tail, parent, newParent);
if (NS_FAILED(rv)) {
return rv;
}
nsContainerFrame::ReparentFrameViewList(tail, parent, newParent);
// The parent's continuation adopts the siblings after the split.
MOZ_ASSERT(!newParent->IsBlockFrameOrSubclass(),
@ -661,8 +656,6 @@ static nsresult SplitInlineAncestors(nsContainerFrame* aParent,
frame = parent;
parent = grandparent;
}
return NS_OK;
}
static void MakeContinuationFluid(nsIFrame* aFrame, nsIFrame* aNext) {
@ -705,9 +698,9 @@ static void JoinInlineAncestors(nsIFrame* aFrame) {
}
}
static nsresult CreateContinuation(nsIFrame* aFrame,
const nsLineList::iterator aLine,
nsIFrame** aNewFrame, bool aIsFluid) {
static void CreateContinuation(nsIFrame* aFrame,
const nsLineList::iterator aLine,
nsIFrame** aNewFrame, bool aIsFluid) {
MOZ_ASSERT(aNewFrame, "null OUT ptr");
MOZ_ASSERT(aFrame, "null ptr");
@ -736,16 +729,14 @@ static nsresult CreateContinuation(nsIFrame* aFrame,
parentLine = nullptr;
}
nsresult rv = NS_OK;
// Have to special case floating first letter frames because the continuation
// doesn't go in the first letter frame. The continuation goes with the rest
// of the text that the first letter frame was made out of.
if (parent->IsLetterFrame() && parent->IsFloating()) {
nsFirstLetterFrame* letterFrame = do_QueryFrame(parent);
rv = letterFrame->CreateContinuationForFloatingParent(presContext, aFrame,
aNewFrame, aIsFluid);
return rv;
letterFrame->CreateContinuationForFloatingParent(presContext, aFrame,
aNewFrame, aIsFluid);
return;
}
*aNewFrame = presShell->FrameConstructor()->CreateContinuingFrame(
@ -759,13 +750,8 @@ static nsresult CreateContinuation(nsIFrame* aFrame,
if (!aIsFluid) {
// Split inline ancestor frames
rv = SplitInlineAncestors(parent, aLine, aFrame);
if (NS_FAILED(rv)) {
return rv;
}
SplitInlineAncestors(parent, aLine, aFrame);
}
return NS_OK;
}
/*
@ -1033,11 +1019,8 @@ nsresult nsBidiPresUtils::ResolveParagraph(BidiParagraphData* aBpd) {
currentLine->MarkDirty();
nsIFrame* nextBidi;
int32_t runEnd = contentOffset + runLength;
rv = EnsureBidiContinuation(frame, currentLine, &nextBidi,
contentOffset, runEnd);
if (NS_FAILED(rv)) {
break;
}
EnsureBidiContinuation(frame, currentLine, &nextBidi, contentOffset,
runEnd);
nextBidi->AdjustOffsetsForBidi(runEnd,
contentOffset + fragmentLength);
frame = nextBidi;
@ -1942,14 +1925,14 @@ nsIFrame* nsBidiPresUtils::GetFrameToLeftOf(const nsIFrame* aFrame,
return nullptr;
}
inline nsresult nsBidiPresUtils::EnsureBidiContinuation(
inline void nsBidiPresUtils::EnsureBidiContinuation(
nsIFrame* aFrame, const nsLineList::iterator aLine, nsIFrame** aNewFrame,
int32_t aStart, int32_t aEnd) {
MOZ_ASSERT(aNewFrame, "null OUT ptr");
MOZ_ASSERT(aFrame, "aFrame is null");
aFrame->AdjustOffsetsForBidi(aStart, aEnd);
return CreateContinuation(aFrame, aLine, aNewFrame, false);
CreateContinuation(aFrame, aLine, aNewFrame, false);
}
void nsBidiPresUtils::RemoveBidiContinuation(BidiParagraphData* aBpd,

Просмотреть файл

@ -546,9 +546,10 @@ class nsBidiPresUtils {
* @see Resolve()
* @see RemoveBidiContinuation()
*/
static inline nsresult EnsureBidiContinuation(
nsIFrame* aFrame, const nsLineList::iterator aLine, nsIFrame** aNewFrame,
int32_t aStart, int32_t aEnd);
static inline void EnsureBidiContinuation(nsIFrame* aFrame,
const nsLineList::iterator aLine,
nsIFrame** aNewFrame,
int32_t aStart, int32_t aEnd);
/**
* Helper method for Resolve()

Просмотреть файл

@ -475,9 +475,9 @@ nsresult nsContainerFrame::ReparentFrameView(nsIFrame* aChildFrame,
return NS_OK;
}
nsresult nsContainerFrame::ReparentFrameViewList(
const nsFrameList& aChildFrameList, nsIFrame* aOldParentFrame,
nsIFrame* aNewParentFrame) {
void nsContainerFrame::ReparentFrameViewList(const nsFrameList& aChildFrameList,
nsIFrame* aOldParentFrame,
nsIFrame* aNewParentFrame) {
MOZ_ASSERT(aChildFrameList.NotEmpty(), "empty child frame list");
MOZ_ASSERT(aOldParentFrame, "null old parent frame pointer");
MOZ_ASSERT(aNewParentFrame, "null new parent frame pointer");
@ -512,7 +512,7 @@ nsresult nsContainerFrame::ReparentFrameViewList(
// and the common parent or the new parent frame and the common parent.
// Because neither the old parent frame nor the new parent frame have views,
// then any child views don't need reparenting
return NS_OK;
return;
}
// We found views for one or both of the ancestor frames before we
@ -531,8 +531,6 @@ nsresult nsContainerFrame::ReparentFrameViewList(
e.get()->ReparentFrameViewTo(viewManager, newParentView, oldParentView);
}
}
return NS_OK;
}
static nsIWidget* GetPresContextContainerWidget(nsPresContext* aPresContext) {

Просмотреть файл

@ -154,9 +154,9 @@ class nsContainerFrame : public nsSplittableFrame {
nsIFrame* aOldParentFrame,
nsIFrame* aNewParentFrame);
static nsresult ReparentFrameViewList(const nsFrameList& aChildFrameList,
nsIFrame* aOldParentFrame,
nsIFrame* aNewParentFrame);
static void ReparentFrameViewList(const nsFrameList& aChildFrameList,
nsIFrame* aOldParentFrame,
nsIFrame* aNewParentFrame);
// Set the view's size and position after its frame has been reflowed.
//

Просмотреть файл

@ -282,7 +282,7 @@ bool nsFirstLetterFrame::CanContinueTextRun() const {
return true;
}
nsresult nsFirstLetterFrame::CreateContinuationForFloatingParent(
void nsFirstLetterFrame::CreateContinuationForFloatingParent(
nsPresContext* aPresContext, nsIFrame* aChild, nsIFrame** aContinuation,
bool aIsFluid) {
NS_ASSERTION(IsFloating(),
@ -322,7 +322,6 @@ nsresult nsFirstLetterFrame::CreateContinuationForFloatingParent(
parent->InsertFrames(kNoReflowPrincipalList, placeholderFrame, nullptr, temp);
*aContinuation = continuation;
return NS_OK;
}
void nsFirstLetterFrame::DrainOverflowFrames(nsPresContext* aPresContext) {

Просмотреть файл

@ -74,10 +74,10 @@ class nsFirstLetterFrame final : public nsContainerFrame {
// place it in the correct place. aContinuation is an outparam for the
// continuation that is created. aIsFluid determines if the continuation is
// fluid or not.
nsresult CreateContinuationForFloatingParent(nsPresContext* aPresContext,
nsIFrame* aChild,
nsIFrame** aContinuation,
bool aIsFluid);
void CreateContinuationForFloatingParent(nsPresContext* aPresContext,
nsIFrame* aChild,
nsIFrame** aContinuation,
bool aIsFluid);
protected:
nscoord mBaseline;