Bug 852501 part 16. Make ConstructFrame infallible. r=dholbert
authorBoris Zbarsky <bzbarsky@mit.edu>
Tue, 19 Mar 2013 21:47:53 -0400
changeset 125542 f090c4fb54b8d3b63641f44e57020d8fc951bd71
parent 125541 24959a8177a2f8f15ffbeae25c5b323e2d7a6c25
child 125543 64bd4a734021ca9e486e16c99348fc0439960e0f
push id24989
push userbzbarsky@mozilla.com
push dateWed, 20 Mar 2013 01:48:20 +0000
treeherdermozilla-inbound@a1237c5af4aa [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdholbert
bugs852501
milestone22.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 852501 part 16. Make ConstructFrame infallible. r=dholbert
layout/base/nsCSSFrameConstructor.cpp
layout/base/nsCSSFrameConstructor.h
--- a/layout/base/nsCSSFrameConstructor.cpp
+++ b/layout/base/nsCSSFrameConstructor.cpp
@@ -4959,17 +4959,17 @@ nsCSSFrameConstructor::AddPageBreakItem(
     FCDATA_DECL(FCDATA_SKIP_FRAMESET, NS_NewPageBreakFrame);
 
   // Lie about the tag and namespace so we don't trigger anything
   // interesting during frame construction.
   aItems.AppendItem(&sPageBreakData, aContent, nsCSSAnonBoxes::pageBreak,
                     kNameSpaceID_None, nullptr, pseudoStyle.forget(), true);
 }
 
-nsresult
+void
 nsCSSFrameConstructor::ConstructFrame(nsFrameConstructorState& aState,
                                       nsIContent*              aContent,
                                       nsIFrame*                aParentFrame,
                                       nsFrameItems&            aFrameItems)
 
 {
   NS_PRECONDITION(aParentFrame, "no parent frame");
   // NOTE: If we start using this code for non-anonymous content, we'll need
@@ -4988,18 +4988,16 @@ nsCSSFrameConstructor::ConstructFrame(ns
   }
   items.SetTriedConstructingFrames();
 
   for (FCItemIterator iter(items); !iter.IsDone(); iter.Next()) {
     NS_ASSERTION(iter.item().DesiredParentType() == GetParentType(aParentFrame),
                  "This is not going to work");
     ConstructFramesFromItem(aState, iter, aParentFrame, aFrameItems);
   }
-
-  return NS_OK;
 }
 
 void
 nsCSSFrameConstructor::AddFrameConstructionItems(nsFrameConstructorState& aState,
                                                  nsIContent* aContent,
                                                  bool aSuppressWhiteSpaceOptimizations,
                                                  nsIFrame* aParentFrame,
                                                  FrameConstructionItemList& aItems)
--- a/layout/base/nsCSSFrameConstructor.h
+++ b/layout/base/nsCSSFrameConstructor.h
@@ -417,20 +417,20 @@ private:
   already_AddRefed<nsStyleContext>
   ResolveStyleContext(nsStyleContext* aParentStyleContext,
                       nsIContent* aContent,
                       nsFrameConstructorState* aState);
 
   // Construct a frame for aContent and put it in aFrameItems.  This should
   // only be used in cases when it's known that the frame won't need table
   // pseudo-frame construction and the like.
-  nsresult ConstructFrame(nsFrameConstructorState& aState,
-                          nsIContent*              aContent,
-                          nsIFrame*                aParentFrame,
-                          nsFrameItems&            aFrameItems);
+  void ConstructFrame(nsFrameConstructorState& aState,
+                      nsIContent*              aContent,
+                      nsIFrame*                aParentFrame,
+                      nsFrameItems&            aFrameItems);
 
   // Add the frame construction items for the given aContent and aParentFrame
   // to the list.  This might add more than one item in some rare cases.
   // If aSuppressWhiteSpaceOptimizations is true, optimizations that
   // may suppress the construction of white-space-only text frames
   // must be skipped for these items and items around them.
   void AddFrameConstructionItems(nsFrameConstructorState& aState,
                                  nsIContent*              aContent,