Bug 1286468 - Remove the old vertical alignment coding style. draft
authorJeremy Chen <jeremychen@mozilla.com>
Sat, 22 Oct 2016 19:41:03 +0800
changeset 428299 baf2c5fe3aba38f6d2e35932b089dd13bea83cf3
parent 428241 5639a9f476d08f300c079117e61697f5026b6367
child 428300 1ffe282dbc243234c5e0fdf31ee313ee728689b3
push id33281
push userjichen@mozilla.com
push dateSat, 22 Oct 2016 11:42:29 +0000
bugs1286468
milestone52.0a1
Bug 1286468 - Remove the old vertical alignment coding style. MozReview-Commit-ID: Ocg21HcL9R
layout/generic/nsBlockFrame.h
--- a/layout/generic/nsBlockFrame.h
+++ b/layout/generic/nsBlockFrame.h
@@ -78,20 +78,20 @@ class BlockReflowInput;
 class nsBlockFrame : public nsContainerFrame
 {
   using BlockReflowInput = mozilla::BlockReflowInput;
 
 public:
   NS_DECL_QUERYFRAME_TARGET(nsBlockFrame)
   NS_DECL_FRAMEARENA_HELPERS
 
-  typedef nsLineList::iterator                  line_iterator;
-  typedef nsLineList::const_iterator            const_line_iterator;
-  typedef nsLineList::reverse_iterator          reverse_line_iterator;
-  typedef nsLineList::const_reverse_iterator    const_reverse_line_iterator;
+  typedef nsLineList::iterator line_iterator;
+  typedef nsLineList::const_iterator const_line_iterator;
+  typedef nsLineList::reverse_iterator reverse_line_iterator;
+  typedef nsLineList::const_reverse_iterator const_reverse_line_iterator;
 
   line_iterator begin_lines() { return mLines.begin(); }
   line_iterator end_lines() { return mLines.end(); }
   const_line_iterator begin_lines() const { return mLines.begin(); }
   const_line_iterator end_lines() const { return mLines.end(); }
   reverse_line_iterator rbegin_lines() { return mLines.rbegin(); }
   reverse_line_iterator rend_lines() { return mLines.rend(); }
   const_reverse_line_iterator rbegin_lines() const { return mLines.rbegin(); }
@@ -101,37 +101,37 @@ public:
 
   friend nsBlockFrame* NS_NewBlockFrame(nsIPresShell* aPresShell,
                                         nsStyleContext* aContext);
 
   // nsQueryFrame
   NS_DECL_QUERYFRAME
 
   // nsIFrame
-  virtual void Init(nsIContent*       aContent,
+  virtual void Init(nsIContent* aContent,
                     nsContainerFrame* aParent,
-                    nsIFrame*         aPrevInFlow) override;
-  virtual void SetInitialChildList(ChildListID     aListID,
-                                   nsFrameList&    aChildList) override;
-  virtual void AppendFrames(ChildListID     aListID,
-                            nsFrameList&    aFrameList) override;
-  virtual void InsertFrames(ChildListID     aListID,
-                            nsIFrame*       aPrevFrame,
-                            nsFrameList&    aFrameList) override;
-  virtual void RemoveFrame(ChildListID     aListID,
-                           nsIFrame*       aOldFrame) override;
+                    nsIFrame* aPrevInFlow) override;
+  virtual void SetInitialChildList(ChildListID aListID,
+                                   nsFrameList& aChildList) override;
+  virtual void AppendFrames(ChildListID aListID,
+                            nsFrameList& aFrameList) override;
+  virtual void InsertFrames(ChildListID aListID,
+                            nsIFrame* aPrevFrame,
+                            nsFrameList& aFrameList) override;
+  virtual void RemoveFrame(ChildListID aListID,
+                           nsIFrame* aOldFrame) override;
   virtual const nsFrameList& GetChildList(ChildListID aListID) const override;
   virtual void GetChildLists(nsTArray<ChildList>* aLists) const override;
   virtual nscoord GetLogicalBaseline(mozilla::WritingMode aWritingMode) const override;
   virtual nscoord GetCaretBaseline() const override;
   virtual void DestroyFrom(nsIFrame* aDestructRoot) override;
   virtual nsSplittableType GetSplittableType() const override;
   virtual bool IsFloatContainingBlock() const override;
-  virtual void BuildDisplayList(nsDisplayListBuilder*   aBuilder,
-                                const nsRect&           aDirtyRect,
+  virtual void BuildDisplayList(nsDisplayListBuilder* aBuilder,
+                                const nsRect& aDirtyRect,
                                 const nsDisplayListSet& aLists) override;
   virtual nsIAtom* GetType() const override;
   virtual bool IsFrameOfType(uint32_t aFlags) const override
   {
     return nsContainerFrame::IsFrameOfType(aFlags &
              ~(nsIFrame::eCanContainOverflowContainers |
                nsIFrame::eBlockFrame));
   }
@@ -284,42 +284,42 @@ public:
    *        to either this or the available block-size, whichever is larger, in
    *        the case where our available block-size is constrained, and we
    *        overflow that available block-size.
    * @param aBorderPadding The margins representing the border padding for block
    *        frames. Can be 0.
    * @param aFinalSize Out parameter for final block-size.
    * @param aConsumed The block-size already consumed by our previous-in-flows.
    */
-  void ComputeFinalBSize(const ReflowInput&      aReflowInput,
-                         nsReflowStatus*               aStatus,
-                         nscoord                       aContentBSize,
+  void ComputeFinalBSize(const ReflowInput& aReflowInput,
+                         nsReflowStatus* aStatus,
+                         nscoord aContentBSize,
                          const mozilla::LogicalMargin& aBorderPadding,
-                         mozilla::LogicalSize&         aFinalSize,
-                         nscoord                       aConsumed);
+                         mozilla::LogicalSize& aFinalSize,
+                         nscoord aConsumed);
 
-  virtual void Reflow(nsPresContext*           aPresContext,
-                      ReflowOutput&     aDesiredSize,
+  virtual void Reflow(nsPresContext* aPresContext,
+                      ReflowOutput& aDesiredSize,
                       const ReflowInput& aReflowInput,
-                      nsReflowStatus&          aStatus) override;
+                      nsReflowStatus& aStatus) override;
 
-  virtual nsresult AttributeChanged(int32_t         aNameSpaceID,
-                                    nsIAtom*        aAttribute,
-                                    int32_t         aModType) override;
+  virtual nsresult AttributeChanged(int32_t aNameSpaceID,
+                                    nsIAtom* aAttribute,
+                                    int32_t aModType) override;
 
   /**
    * Move any frames on our overflow list to the end of our principal list.
    * @return true if there were any overflow frames
    */
   virtual bool DrainSelfOverflowList() override;
 
   virtual nsresult StealFrame(nsIFrame* aChild) override;
 
   virtual void DeleteNextInFlowChild(nsIFrame* aNextInFlow,
-                                     bool      aDeletingEmptyFrames) override;
+                                     bool aDeletingEmptyFrames) override;
 
   /**
     * This is a special method that allows a child class of nsBlockFrame to
     * return a special, customized nsStyleText object to the nsLineLayout
     * constructor. It is used when the nsBlockFrame child needs to specify its
     * custom rendering style.
     */
   virtual const nsStyleText* StyleTextForLineLayout();
@@ -363,28 +363,27 @@ public:
                            const mozilla::LogicalRect& aFloatAvailableSpace,
                            nsIFrame* aFrame);
 
   /**
    * Creates a contination for aFloat and adds it to the list of overflow floats.
    * Also updates aState.mReflowStatus to include the float's incompleteness.
    * Must only be called while this block frame is in reflow.
    * aFloatStatus must be the float's true, unmodified reflow status.
-   * 
    */
   nsresult SplitFloat(BlockReflowInput& aState,
-                      nsIFrame*           aFloat,
-                      nsReflowStatus      aFloatStatus);
+                      nsIFrame* aFloat,
+                      nsReflowStatus aFloatStatus);
 
   /**
    * Walks up the frame tree, starting with aCandidate, and returns the first
    * block frame that it encounters.
    */
   static nsBlockFrame* GetNearestAncestorBlock(nsIFrame* aCandidate);
-  
+
   struct FrameLines {
     nsLineList mLines;
     nsFrameList mFrames;
   };
 
 protected:
   explicit nsBlockFrame(nsStyleContext* aContext)
     : nsContainerFrame(aContext)
@@ -423,40 +422,40 @@ protected:
    * Helper method for StealFrame.
    */
   void RemoveFrameFromLine(nsIFrame* aChild, nsLineList::iterator aLine,
                            nsFrameList& aFrameList, nsLineList& aLineList);
 
   void TryAllLines(nsLineList::iterator* aIterator,
                    nsLineList::iterator* aStartIterator,
                    nsLineList::iterator* aEndIterator,
-                   bool*        aInOverflowLines,
+                   bool* aInOverflowLines,
                    FrameLines** aOverflowLines);
 
   /** move the frames contained by aLine by aDeltaBCoord
     * if aLine is a block, its child floats are added to the state manager
     */
   void SlideLine(BlockReflowInput& aState,
                  nsLineBox* aLine, nscoord aDeltaBCoord);
 
   void UpdateLineContainerSize(nsLineBox* aLine,
                                const nsSize& aNewContainerSize);
 
   // helper for SlideLine and UpdateLineContainerSize
   void MoveChildFramesOfLine(nsLineBox* aLine, nscoord aDeltaBCoord);
 
   void ComputeFinalSize(const ReflowInput& aReflowInput,
-                        BlockReflowInput&      aState,
-                        ReflowOutput&     aMetrics,
-                        nscoord*                 aBottomEdgeOfChildren);
+                        BlockReflowInput& aState,
+                        ReflowOutput& aMetrics,
+                        nscoord* aBottomEdgeOfChildren);
 
-  void ComputeOverflowAreas(const nsRect&         aBounds,
+  void ComputeOverflowAreas(const nsRect& aBounds,
                             const nsStyleDisplay* aDisplay,
-                            nscoord               aBottomEdgeOfChildren,
-                            nsOverflowAreas&      aOverflowAreas);
+                            nscoord aBottomEdgeOfChildren,
+                            nsOverflowAreas& aOverflowAreas);
 
   /**
    * Add the frames in aFrameList to this block after aPrevSibling.
    * This block thinks in terms of lines, but the frame construction code
    * knows nothing about lines at all so we need to find the line that
    * contains aPrevSibling and add aFrameList after aPrevSibling on that line.
    * New lines are created as necessary to handle block data in aFrameList.
    * This function will clear aFrameList.
@@ -495,36 +494,36 @@ public:
    * if REMOVE_FIXED_CONTINUATIONS is given)
    * -- marks lines dirty as needed
    * -- marks textruns dirty (unless FRAMES_ARE_EMPTY is given, in which
    * case textruns do not need to be dirtied)
    * -- destroys all removed frames
    */
   enum {
     REMOVE_FIXED_CONTINUATIONS = 0x02,
-    FRAMES_ARE_EMPTY           = 0x04
+    FRAMES_ARE_EMPTY = 0x04
   };
   void DoRemoveFrame(nsIFrame* aDeletedFrame, uint32_t aFlags);
 
   void ReparentFloats(nsIFrame* aFirstFrame, nsBlockFrame* aOldParent,
                       bool aReparentSiblings);
 
   virtual bool ComputeCustomOverflow(nsOverflowAreas& aOverflowAreas) override;
 
   virtual void UnionChildOverflow(nsOverflowAreas& aOverflowAreas) override;
 
   /** Load all of aFrame's floats into the float manager iff aFrame is not a
    *  block formatting context. Handles all necessary float manager translations;
    *  assumes float manager is in aFrame's parent's coord system.
    *  Safe to call on non-blocks (does nothing).
    */
-  static void RecoverFloatsFor(nsIFrame*            aFrame,
-                               nsFloatManager&      aFloatManager,
+  static void RecoverFloatsFor(nsIFrame* aFrame,
+                               nsFloatManager& aFloatManager,
                                mozilla::WritingMode aWM,
-                               const nsSize&        aContainerSize);
+                               const nsSize& aContainerSize);
 
   /**
    * Determine if we have any pushed floats from a previous continuation.
    *
    * @returns true, if any of the floats at the beginning of our mFloats list
    *          have the NS_FRAME_IS_PUSHED_FLOAT bit set; false otherwise.
    */
   bool HasPushedFloatsFromPrevContinuation() const {
@@ -588,25 +587,25 @@ protected:
    * First calls DrainSelfPushedFloats() then grabs pushed floats from this
    * block's prev-in-flow, and splice them into this block's mFloats list too.
    */
   void DrainPushedFloats();
 
   /** Load all our floats into the float manager (without reflowing them).
    *  Assumes float manager is in our own coordinate system.
    */
-  void RecoverFloats(nsFloatManager&      aFloatManager,
+  void RecoverFloats(nsFloatManager& aFloatManager,
                      mozilla::WritingMode aWM,
-                     const nsSize&        aContainerSize);
+                     const nsSize& aContainerSize);
 
   /** Reflow pushed floats
    */
   void ReflowPushedFloats(BlockReflowInput& aState,
-                          nsOverflowAreas&    aOverflowAreas,
-                          nsReflowStatus&     aStatus);
+                          nsOverflowAreas& aOverflowAreas,
+                          nsReflowStatus& aStatus);
 
   /** Find any trailing BR clear from the last line of the block (or its PIFs)
    */
   mozilla::StyleClear FindTrailingClear();
 
   /**
    * Remove a float from our float list.
    */
@@ -650,23 +649,23 @@ protected:
    */
   void ReflowLine(BlockReflowInput& aState,
                   line_iterator aLine,
                   bool* aKeepReflowGoing);
 
   // Return false if it needs another reflow because of reduced space
   // between floats that are next to it (but not next to its top), and
   // return true otherwise.
-  bool PlaceLine(BlockReflowInput&           aState,
-                   nsLineLayout&               aLineLayout,
-                   line_iterator               aLine,
-                   nsFloatManager::SavedState* aFloatStateBeforeLine,
-                   mozilla::LogicalRect&       aFloatAvailableSpace, //in-out
-                   nscoord&                    aAvailableSpaceHeight, // in-out
-                   bool*                       aKeepReflowGoing);
+  bool PlaceLine(BlockReflowInput& aState,
+                 nsLineLayout& aLineLayout,
+                 line_iterator aLine,
+                 nsFloatManager::SavedState* aFloatStateBeforeLine,
+                 mozilla::LogicalRect& aFloatAvailableSpace, //in-out
+                 nscoord& aAvailableSpaceHeight, // in-out
+                 bool* aKeepReflowGoing);
 
   /**
     * If NS_BLOCK_LOOK_FOR_DIRTY_FRAMES is set, call MarkLineDirty
     * on any line with a child frame that is dirty.
     */
   void LazyMarkLinesDirty();
 
   /**
@@ -716,90 +715,90 @@ protected:
   void ReflowInlineFrame(BlockReflowInput& aState,
                          nsLineLayout& aLineLayout,
                          line_iterator aLine,
                          nsIFrame* aFrame,
                          LineReflowStatus* aLineReflowStatus);
 
   // Compute the available inline size for a float.
   mozilla::LogicalRect AdjustFloatAvailableSpace(
-                         BlockReflowInput&         aState,
+                         BlockReflowInput& aState,
                          const mozilla::LogicalRect& aFloatAvailableSpace,
-                         nsIFrame*                   aFloatFrame);
+                         nsIFrame* aFloatFrame);
   // Computes the border-box inline size of the float
-  nscoord ComputeFloatISize(BlockReflowInput&         aState,
+  nscoord ComputeFloatISize(BlockReflowInput& aState,
                             const mozilla::LogicalRect& aFloatAvailableSpace,
-                            nsIFrame*                   aFloat);
+                            nsIFrame* aFloat);
   // An incomplete aReflowStatus indicates the float should be split
   // but only if the available height is constrained.
   // aAdjustedAvailableSpace is the result of calling
   // nsBlockFrame::AdjustFloatAvailableSpace.
-  void ReflowFloat(BlockReflowInput&         aState,
+  void ReflowFloat(BlockReflowInput& aState,
                    const mozilla::LogicalRect& aAdjustedAvailableSpace,
-                   nsIFrame*                   aFloat,
-                   mozilla::LogicalMargin&     aFloatMargin,
-                   mozilla::LogicalMargin&     aFloatOffsets,
+                   nsIFrame* aFloat,
+                   mozilla::LogicalMargin& aFloatMargin,
+                   mozilla::LogicalMargin& aFloatOffsets,
                    // Whether the float's position
                    // (aAdjustedAvailableSpace) has been pushed down
                    // due to the presence of other floats.
-                   bool                        aFloatPushedDown,
-                   nsReflowStatus&             aReflowStatus);
+                   bool aFloatPushedDown,
+                   nsReflowStatus& aReflowStatus);
 
   //----------------------------------------
   // Methods for pushing/pulling lines/frames
 
   /**
    * Create a next-in-flow, if necessary, for aFrame. If a new frame is
    * created, place it in aLine if aLine is not null.
    * @param aState the block reflow state
    * @param aLine where to put a new frame
    * @param aFrame the frame
    * @return true if a new frame was created, false if not
    */
   bool CreateContinuationFor(BlockReflowInput& aState,
-                             nsLineBox*          aLine,
-                             nsIFrame*           aFrame);
+                             nsLineBox* aLine,
+                             nsIFrame* aFrame);
 
   /**
    * Push aLine (and any after it), since it cannot be placed on this
    * page/column.  Set aKeepReflowGoing to false and set
    * flag aState.mReflowStatus as incomplete.
    */
   void PushTruncatedLine(BlockReflowInput& aState,
-                         line_iterator       aLine,
-                         bool*               aKeepReflowGoing);
+                         line_iterator aLine,
+                         bool* aKeepReflowGoing);
 
   void SplitLine(BlockReflowInput& aState,
                  nsLineLayout& aLineLayout,
                  line_iterator aLine,
                  nsIFrame* aFrame,
                  LineReflowStatus* aLineReflowStatus);
 
   /**
    * Pull a frame from the next available location (one of our lines or
    * one of our next-in-flows lines).
    * @return the pulled frame or nullptr
    */
   nsIFrame* PullFrame(BlockReflowInput& aState,
-                      line_iterator       aLine);
+                      line_iterator aLine);
 
   /**
    * Try to pull a frame out of a line pointed at by aFromLine.
    *
    * Note: pulling a frame from a line that is a place-holder frame
    * doesn't automatically remove the corresponding float from the
    * line's float array. This happens indirectly: either the line gets
    * emptied (and destroyed) or the line gets reflowed (because we mark
    * it dirty) and the code at the top of ReflowLine empties the
    * array. So eventually, it will be removed, just not right away.
    *
    * @return the pulled frame or nullptr
    */
-  nsIFrame* PullFrameFrom(nsLineBox*           aLine,
-                          nsBlockFrame*        aFromContainer,
+  nsIFrame* PullFrameFrom(nsLineBox* aLine,
+                          nsBlockFrame* aFromContainer,
                           nsLineList::iterator aFromLine);
 
   /**
    * Push the line after aLineBefore to the overflow line list.
    * @param aLineBefore a line in 'mLines' (or begin_lines() when
    *        pushing the first line)
    */
   void PushLines(BlockReflowInput& aState,
@@ -1008,17 +1007,17 @@ public:
 
 private:
   friend class nsBlockFrame;
   // XXX nsBlockFrame uses this internally in one place.  Try to remove it.
   nsBlockInFlowLineIterator(nsBlockFrame* aFrame, line_iterator aLine, bool aInOverflow);
 
   nsBlockFrame* mFrame;
   line_iterator mLine;
-  nsLineList*   mLineList;  // the line list mLine is in
+  nsLineList* mLineList;  // the line list mLine is in
 
   /**
    * Moves iterator to next valid line reachable from the current block.
    * Returns false if there are no valid lines.
    */
   bool FindValidLine();
 };