Bug 1509903 part 2 - Make the remaining nsTextFrame virtual methods 'final' unless they are overridden by nsContinuingTextFrame. r=emilio
authorMats Palmgren <mats@mozilla.com>
Thu, 29 Nov 2018 00:17:25 +0100
changeset 507883 50f492dc4eda48eaf11a20ef1ac729ae14396fd7
parent 507882 69bf9d3d6b3cce3e8d4d44dcd5b70c5e76054ecf
child 507884 d321a6c5e0718dc0f8e26c567555ed296c751d9e
push id1905
push userffxbld-merge
push dateMon, 21 Jan 2019 12:33:13 +0000
treeherdermozilla-release@c2fca1944d8c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
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 1509903 part 2 - Make the remaining nsTextFrame virtual methods 'final' unless they are overridden by nsContinuingTextFrame. r=emilio
--- a/layout/generic/nsTextFrame.h
+++ b/layout/generic/nsTextFrame.h
@@ -67,25 +67,25 @@ public:
   friend class nsDisplayTextGeometry;
   friend class nsDisplayText;
   // nsQueryFrame
   // nsIFrame
   void BuildDisplayList(nsDisplayListBuilder* aBuilder,
-                        const nsDisplayListSet& aLists) override;
+                        const nsDisplayListSet& aLists) final;
   void Init(nsIContent* aContent,
             nsContainerFrame* aParent,
             nsIFrame* aPrevInFlow) override;
   void DestroyFrom(nsIFrame* aDestructRoot, PostDestroyData& aPostDestroyData) override;
-  nsresult GetCursor(const nsPoint& aPoint, nsIFrame::Cursor& aCursor) override;
+  nsresult GetCursor(const nsPoint& aPoint, nsIFrame::Cursor& aCursor) final;
   nsresult CharacterDataChanged(const CharacterDataChangeInfo&) final;
   nsTextFrame* GetPrevContinuation() const override { return nullptr; }
   nsTextFrame* GetNextContinuation() const final { return mNextContinuation; }
   void SetNextContinuation(nsIFrame* aNextContinuation) final
     NS_ASSERTION(!aNextContinuation || Type() == aNextContinuation->Type(),
@@ -98,17 +98,17 @@ public:
     // Setting a non-fluid continuation might affect our flow length (they're
     // quite rare so we assume it always does) so we delete our cached value:
     if (GetContent()->HasFlag(NS_HAS_FLOWLENGTH_PROPERTY)) {
-  nsIFrame* GetNextInFlowVirtual() const override { return GetNextInFlow(); }
+  nsIFrame* GetNextInFlowVirtual() const final { return GetNextInFlow(); }
   nsTextFrame* GetNextInFlow() const
     return mNextContinuation &&
                (mNextContinuation->GetStateBits() &
              ? mNextContinuation
              : nullptr;
@@ -151,30 +151,30 @@ public:
     // a whitespace is only contained by pseudo ruby frames, its style
     // context won't have SuppressLineBreak bit set.
     if (mozilla::RubyUtils::IsRubyContentBox(GetParent()->Type())) {
       return true;
     return Style()->ShouldSuppressLineBreak();
-  void InvalidateFrame(uint32_t aDisplayItemKey = 0, bool aRebuildDisplayItems = true) override;
+  void InvalidateFrame(uint32_t aDisplayItemKey = 0, bool aRebuildDisplayItems = true) final;
   void InvalidateFrameWithRect(const nsRect& aRect,
                                uint32_t aDisplayItemKey = 0,
-                               bool aRebuildDisplayItems = true) override;
+                               bool aRebuildDisplayItems = true) final;
   void List(FILE* out = stderr,
             const char* aPrefix = "",
-            uint32_t aFlags = 0) const override;
-  nsresult GetFrameName(nsAString& aResult) const override;
+            uint32_t aFlags = 0) const final;
+  nsresult GetFrameName(nsAString& aResult) const final;
   void ToCString(nsCString& aBuf, int32_t* aTotalContentLength) const;
-  ContentOffsets CalcContentOffsetsFromFramePoint(const nsPoint& aPoint) override;
+  ContentOffsets CalcContentOffsetsFromFramePoint(const nsPoint& aPoint) final;
   ContentOffsets GetCharacterOffsetAtFramePoint(const nsPoint& aPoint);
    * This is called only on the primary text frame. It indicates that
    * the selection state of the given character range has changed.
    * Text in the range is unconditionally invalidated
    * (Selection::Repaint depends on this).
    * @param aSelected true if the selection has been added to the range,
@@ -182,67 +182,67 @@ public:
    * @param aType the type of selection added or removed
   void SetSelectedRange(uint32_t aStart,
                         uint32_t aEnd,
                         bool aSelected,
                         SelectionType aSelectionType);
   FrameSearchResult PeekOffsetNoAmount(bool aForward,
-                                       int32_t* aOffset) override;
+                                       int32_t* aOffset) final;
   PeekOffsetCharacter(bool aForward,
                       int32_t* aOffset,
                       PeekOffsetCharacterOptions aOptions =
-                        PeekOffsetCharacterOptions()) override;
+                        PeekOffsetCharacterOptions()) final;
   FrameSearchResult PeekOffsetWord(bool aForward,
                                    bool aWordSelectEatSpace,
                                    bool aIsKeyboardSelect,
                                    int32_t* aOffset,
-                                   PeekWordState* aState) override;
+                                   PeekWordState* aState) final;
   nsresult CheckVisibility(nsPresContext* aContext,
                            int32_t aStartIndex,
                            int32_t aEndIndex,
                            bool aRecurse,
                            bool* aFinished,
-                           bool* _retval) override;
+                           bool* _retval) final;
   // Flags for aSetLengthFlags
   // Update offsets to account for new length. This may clear mTextRun.
   void SetLength(int32_t aLength,
                  nsLineLayout* aLineLayout,
                  uint32_t aSetLengthFlags = 0);
-  nsresult GetOffsets(int32_t& start, int32_t& end) const override;
+  nsresult GetOffsets(int32_t& start, int32_t& end) const final;
-  void AdjustOffsetsForBidi(int32_t start, int32_t end) override;
+  void AdjustOffsetsForBidi(int32_t start, int32_t end) final;
-  nsresult GetPointFromOffset(int32_t inOffset, nsPoint* outPoint) override;
+  nsresult GetPointFromOffset(int32_t inOffset, nsPoint* outPoint) final;
   nsresult GetCharacterRectsInRange(int32_t aInOffset,
                                     int32_t aLength,
-                                    nsTArray<nsRect>& aRects) override;
+                                    nsTArray<nsRect>& aRects) final;
   nsresult GetChildFrameContainingOffset(int32_t inContentOffset,
                                          bool inHint,
                                          int32_t* outFrameContentOffset,
-                                         nsIFrame** outChildFrame) override;
+                                         nsIFrame** outChildFrame) final;
-  bool IsVisibleInSelection(mozilla::dom::Selection* aSelection) override;
+  bool IsVisibleInSelection(mozilla::dom::Selection* aSelection) final;
-  bool IsEmpty() override;
-  bool IsSelfEmpty() override { return IsEmpty(); }
+  bool IsEmpty() final;
+  bool IsSelfEmpty() final { return IsEmpty(); }
   nscoord GetLogicalBaseline(mozilla::WritingMode aWritingMode) const final;
-  bool HasSignificantTerminalNewline() const override;
+  bool HasSignificantTerminalNewline() const final;
    * Returns true if this text frame is logically adjacent to the end of the
    * line.
   bool IsAtEndOfLine() const;
@@ -250,51 +250,51 @@ public:
    * characters are present.
   bool HasNoncollapsedCharacters() const
     return (GetStateBits() & TEXT_HAS_NONCOLLAPSED_CHARACTERS) != 0;
-  mozilla::a11y::AccType AccessibleType() override;
+  mozilla::a11y::AccType AccessibleType() final;
   float GetFontSizeInflation() const;
   bool IsCurrentFontInflation(float aInflation) const;
   bool HasFontSizeInflation() const
     return (GetStateBits() & TEXT_HAS_FONT_INFLATION) != 0;
   void SetFontSizeInflation(float aInflation);
-  void MarkIntrinsicISizesDirty() override;
-  nscoord GetMinISize(gfxContext* aRenderingContext) override;
-  nscoord GetPrefISize(gfxContext* aRenderingContext) override;
+  void MarkIntrinsicISizesDirty() final;
+  nscoord GetMinISize(gfxContext* aRenderingContext) final;
+  nscoord GetPrefISize(gfxContext* aRenderingContext) final;
   void AddInlineMinISize(gfxContext* aRenderingContext,
                          InlineMinISizeData* aData) override;
   void AddInlinePrefISize(gfxContext* aRenderingContext,
                           InlinePrefISizeData* aData) override;
   mozilla::LogicalSize ComputeSize(gfxContext* aRenderingContext,
                                    mozilla::WritingMode aWritingMode,
                                    const mozilla::LogicalSize& aCBSize,
                                    nscoord aAvailableISize,
                                    const mozilla::LogicalSize& aMargin,
                                    const mozilla::LogicalSize& aBorder,
                                    const mozilla::LogicalSize& aPadding,
-                                   ComputeSizeFlags aFlags) override;
-  nsRect ComputeTightBounds(DrawTarget* aDrawTarget) const override;
+                                   ComputeSizeFlags aFlags) final;
+  nsRect ComputeTightBounds(DrawTarget* aDrawTarget) const final;
   nsresult GetPrefWidthTightBounds(gfxContext* aContext,
                                    nscoord* aX,
-                                   nscoord* aXMost) override;
+                                   nscoord* aXMost) final;
   void Reflow(nsPresContext* aPresContext,
               ReflowOutput& aMetrics,
               const ReflowInput& aReflowInput,
-              nsReflowStatus& aStatus) override;
-  bool CanContinueTextRun() const override;
+              nsReflowStatus& aStatus) final;
+  bool CanContinueTextRun() const final;
   // Method that is called for a text frame that is logically
   // adjacent to the end of the line (i.e. followed only by empty text frames,
   // placeholders or inlines containing such).
   struct TrimOutput
     // true if we trimmed some space or changed metrics in some other way.
     // In this case, we should call RecomputeOverflow on this frame.
     bool mChanged;
@@ -302,17 +302,17 @@ public:
     nscoord mDeltaWidth;
   TrimOutput TrimTrailingWhiteSpace(DrawTarget* aDrawTarget);
   RenderedText GetRenderedText(
     uint32_t aStartOffset = 0,
     uint32_t aEndOffset = UINT32_MAX,
     TextOffsetType aOffsetType = TextOffsetType::OFFSETS_IN_CONTENT_TEXT,
     TrailingWhitespace aTrimTrailingWhitespace =
-      TrailingWhitespace::TRIM_TRAILING_WHITESPACE) override;
+      TrailingWhitespace::TRIM_TRAILING_WHITESPACE) final;
   nsOverflowAreas RecomputeOverflow(nsIFrame* aBlockFrame);
   enum TextRunType
     // Anything in reflow (but not intrinsic width calculation) or
     // painting should use the inflated text run (i.e., with font size
     // inflation applied).
@@ -539,17 +539,17 @@ public:
   void DrawEmphasisMarks(gfxContext* aContext,
                          mozilla::WritingMode aWM,
                          const mozilla::gfx::Point& aTextBaselinePt,
                          const mozilla::gfx::Point& aFramePt,
                          Range aRange,
                          const nscolor* aDecorationOverrideColor,
                          PropertyProvider* aProvider);
-  nscolor GetCaretColorAt(int32_t aOffset) override;
+  nscolor GetCaretColorAt(int32_t aOffset) final;
   int16_t GetSelectionStatus(int16_t* aSelectionFlags);
   int32_t GetContentOffset() const { return mContentOffset; }
   int32_t GetContentLength() const
     NS_ASSERTION(GetContentEnd() - mContentOffset >= 0, "negative length");
     return GetContentEnd() - mContentOffset;
@@ -650,24 +650,24 @@ public:
                   DrawTarget* aDrawTarget,
                   ReflowOutput& aMetrics,
                   nsReflowStatus& aStatus);
   bool IsFloatingFirstLetterChild() const;
   bool IsInitialLetterChild() const;
-  bool ComputeCustomOverflow(nsOverflowAreas& aOverflowAreas) override;
+  bool ComputeCustomOverflow(nsOverflowAreas& aOverflowAreas) final;
   void AssignJustificationGaps(const mozilla::JustificationAssignment& aAssign);
   mozilla::JustificationAssignment GetJustificationAssignment() const;
   uint32_t CountGraphemeClusters() const;
-  bool HasAnyNoncollapsedCharacters() override;
+  bool HasAnyNoncollapsedCharacters() final;
    * Call this after you have manually changed the text node contents without
    * notifying that change.  This behaves as if all the text contents changed.
    * (You should only use this for native anonymous content.)
   void NotifyNativeAnonymousTextnodeChange(uint32_t aOldLength);