Bug 1251519 Part 1 - Remove nsTextFrameBase as an nsFrame alias. r?mats draft
authorTing-Yu Lin <tlin@mozilla.com>
Thu, 10 Mar 2016 17:38:31 +0800
changeset 338983 99595b41c69e38b0828d25556bac02ae6e98cbb6
parent 338591 af7c0cb0798f5425d5d344cbaf0ac0ecb1a72a86
child 338984 9e03b4b71ebdbbde762b84dd1e193cdcb43214d1
push id12625
push usertlin@mozilla.com
push dateThu, 10 Mar 2016 09:49:24 +0000
reviewersmats
bugs1251519, 655877
milestone48.0a1
Bug 1251519 Part 1 - Remove nsTextFrameBase as an nsFrame alias. r?mats Bug 655877 Part 20 made this deliberately to let nsTextFrame QueryFrame-able. https://hg.mozilla.org/mozilla-central/rev/d8c6025c0881 But other types like nsPlaceholderFrame or nsBulletFrame are also implemented QureyFrame, which do not have this inheritance indirection. I guess it was for historical reason, and can be removed safely. MozReview-Commit-ID: CPeQvpKzEKh
layout/generic/nsTextFrame.cpp
layout/generic/nsTextFrame.h
--- a/layout/generic/nsTextFrame.cpp
+++ b/layout/generic/nsTextFrame.cpp
@@ -2681,17 +2681,17 @@ BuildTextRunsScanner::AssignTextRun(gfxT
         ? TEXT_IN_TEXTRUN_USER_DATA
         : TEXT_IN_UNINFLATED_TEXTRUN_USER_DATA;
     startFrame->AddStateBits(whichTextRunState);
   }
 }
 
 NS_QUERYFRAME_HEAD(nsTextFrame)
   NS_QUERYFRAME_ENTRY(nsTextFrame)
-NS_QUERYFRAME_TAIL_INHERITING(nsTextFrameBase)
+NS_QUERYFRAME_TAIL_INHERITING(nsFrame)
 
 gfxSkipCharsIterator
 nsTextFrame::EnsureTextRun(TextRunType aWhichTextRun,
                            DrawTarget* aRefDrawTarget,
                            nsIFrame* aLineContainer,
                            const nsLineList::iterator* aLine,
                            uint32_t* aFlowEndInTextRun)
 {
@@ -4442,30 +4442,30 @@ nsTextFrame::InvalidateFrame(uint32_t aD
 {
   if (IsSVGText()) {
     nsIFrame* svgTextFrame =
       nsLayoutUtils::GetClosestFrameOfType(GetParent(),
                                            nsGkAtoms::svgTextFrame);
     svgTextFrame->InvalidateFrame();
     return;
   }
-  nsTextFrameBase::InvalidateFrame(aDisplayItemKey);
+  nsFrame::InvalidateFrame(aDisplayItemKey);
 }
 
 void
 nsTextFrame::InvalidateFrameWithRect(const nsRect& aRect, uint32_t aDisplayItemKey)
 {
   if (IsSVGText()) {
     nsIFrame* svgTextFrame =
       nsLayoutUtils::GetClosestFrameOfType(GetParent(),
                                            nsGkAtoms::svgTextFrame);
     svgTextFrame->InvalidateFrame();
     return;
   }
-  nsTextFrameBase::InvalidateFrameWithRect(aRect, aDisplayItemKey);
+  nsFrame::InvalidateFrameWithRect(aRect, aDisplayItemKey);
 }
 
 gfxTextRun*
 nsTextFrame::GetUninflatedTextRun()
 {
   return Properties().Get(UninflatedTextRunProperty());
 }
 
--- a/layout/generic/nsTextFrame.h
+++ b/layout/generic/nsTextFrame.h
@@ -23,28 +23,26 @@
 #undef DrawText
 #endif
 
 class nsTextPaintStyle;
 class PropertyProvider;
 struct SelectionDetails;
 class nsTextFragment;
 
-typedef nsFrame nsTextFrameBase;
-
 class nsDisplayTextGeometry;
 class nsDisplayText;
 
 class nsTextFrameTextRunCache {
 public:
   static void Init();
   static void Shutdown();
 };
 
-class nsTextFrame : public nsTextFrameBase {
+class nsTextFrame : public nsFrame {
   typedef mozilla::LayoutDeviceRect LayoutDeviceRect;
   typedef mozilla::TextRangeStyle TextRangeStyle;
   typedef mozilla::gfx::DrawTarget DrawTarget;
   typedef mozilla::gfx::Point Point;
   typedef mozilla::gfx::Rect Rect;
   typedef mozilla::gfx::Size Size;
   typedef gfxTextRun::Range Range;
 
@@ -52,17 +50,17 @@ public:
   NS_DECL_QUERYFRAME_TARGET(nsTextFrame)
   NS_DECL_FRAMEARENA_HELPERS
 
   friend class nsContinuingTextFrame;
   friend class nsDisplayTextGeometry;
   friend class nsDisplayText;
 
   explicit nsTextFrame(nsStyleContext* aContext)
-    : nsTextFrameBase(aContext)
+    : nsFrame(aContext)
   {
     NS_ASSERTION(mContentOffset == 0, "Bogus content offset");
   }
   
   // nsQueryFrame
   NS_DECL_QUERYFRAME
 
   // nsIFrame