Bug 1052924 - Resolve some warnings. r=dbaron
authorXidorn Quan <quanxunzhen@gmail.com>
Wed, 26 Nov 2014 15:52:49 +1100
changeset 241884 002f76d56d0f1d7d81d5f88ac3b690ca62de7876
parent 241883 d52caef15e10b32a7e9c48ab7ef5a79c8a1e2dec
child 241885 33dddb6ab137d28182a414a241529a8169d95fb8
push id4311
push userraliiev@mozilla.com
push dateMon, 12 Jan 2015 19:37:41 +0000
treeherdermozilla-beta@150c9fed433b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdbaron
bugs1052924
milestone36.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 1052924 - Resolve some warnings. r=dbaron Important changes: * Change base class of nsRuby{Base,Text}Frame to nsInlineFrame * Make ComputeSize of nsRubyFrame and nsRubyBaseContainerFrame behavior like inline frames
layout/generic/nsHTMLReflowState.cpp
layout/generic/nsRubyBaseContainerFrame.cpp
layout/generic/nsRubyBaseContainerFrame.h
layout/generic/nsRubyBaseFrame.cpp
layout/generic/nsRubyBaseFrame.h
layout/generic/nsRubyFrame.cpp
layout/generic/nsRubyFrame.h
layout/generic/nsRubyTextContainerFrame.cpp
layout/generic/nsRubyTextContainerFrame.h
layout/generic/nsRubyTextFrame.cpp
layout/generic/nsRubyTextFrame.h
--- a/layout/generic/nsHTMLReflowState.cpp
+++ b/layout/generic/nsHTMLReflowState.cpp
@@ -746,27 +746,32 @@ nsHTMLReflowState::InitFrameType(nsIAtom
   else {
     switch (GetDisplay()) {
     case NS_STYLE_DISPLAY_BLOCK:
     case NS_STYLE_DISPLAY_LIST_ITEM:
     case NS_STYLE_DISPLAY_TABLE:
     case NS_STYLE_DISPLAY_TABLE_CAPTION:
     case NS_STYLE_DISPLAY_FLEX:
     case NS_STYLE_DISPLAY_GRID:
+    case NS_STYLE_DISPLAY_RUBY_TEXT_CONTAINER:
       frameType = NS_CSS_FRAME_TYPE_BLOCK;
       break;
 
     case NS_STYLE_DISPLAY_INLINE:
     case NS_STYLE_DISPLAY_INLINE_BLOCK:
     case NS_STYLE_DISPLAY_INLINE_TABLE:
     case NS_STYLE_DISPLAY_INLINE_BOX:
     case NS_STYLE_DISPLAY_INLINE_XUL_GRID:
     case NS_STYLE_DISPLAY_INLINE_STACK:
     case NS_STYLE_DISPLAY_INLINE_FLEX:
     case NS_STYLE_DISPLAY_INLINE_GRID:
+    case NS_STYLE_DISPLAY_RUBY:
+    case NS_STYLE_DISPLAY_RUBY_BASE:
+    case NS_STYLE_DISPLAY_RUBY_TEXT:
+    case NS_STYLE_DISPLAY_RUBY_BASE_CONTAINER:
       frameType = NS_CSS_FRAME_TYPE_INLINE;
       break;
 
     case NS_STYLE_DISPLAY_TABLE_CELL:
     case NS_STYLE_DISPLAY_TABLE_ROW_GROUP:
     case NS_STYLE_DISPLAY_TABLE_COLUMN:
     case NS_STYLE_DISPLAY_TABLE_COLUMN_GROUP:
     case NS_STYLE_DISPLAY_TABLE_HEADER_GROUP:
--- a/layout/generic/nsRubyBaseContainerFrame.cpp
+++ b/layout/generic/nsRubyBaseContainerFrame.cpp
@@ -197,16 +197,31 @@ void nsRubyBaseContainerFrame::ClearText
 }
 
 /* virtual */ bool
 nsRubyBaseContainerFrame::CanContinueTextRun() const
 {
   return true;
 }
 
+/* virtual */ LogicalSize
+nsRubyBaseContainerFrame::ComputeSize(nsRenderingContext *aRenderingContext,
+                                      WritingMode aWM,
+                                      const LogicalSize& aCBSize,
+                                      nscoord aAvailableISize,
+                                      const LogicalSize& aMargin,
+                                      const LogicalSize& aBorder,
+                                      const LogicalSize& aPadding,
+                                      ComputeSizeFlags aFlags)
+{
+  // Ruby base container frame is inline,
+  // hence don't compute size before reflow.
+  return LogicalSize(aWM, NS_UNCONSTRAINEDSIZE, NS_UNCONSTRAINEDSIZE);
+}
+
 /* virtual */ void
 nsRubyBaseContainerFrame::Reflow(nsPresContext* aPresContext,
                                  nsHTMLReflowMetrics& aDesiredSize,
                                  const nsHTMLReflowState& aReflowState,
                                  nsReflowStatus& aStatus)
 {
   DO_GLOBAL_REFLOW_COUNT("nsRubyBaseContainerFrame");
   DISPLAY_REFLOW(aPresContext, this, aReflowState, aDesiredSize, aStatus);
@@ -290,30 +305,34 @@ nsRubyBaseContainerFrame::Reflow(nsPresC
       nsRubyTextFrame* rtFrame = do_QueryFrame(e.GetTextFrame(i));
       if (rtFrame) {
         nsReflowStatus reflowStatus;
         nsHTMLReflowMetrics metrics(*rtcReflowStates[i]);
 
         bool pushedFrame;
         rtcReflowStates[i]->mLineLayout->ReflowFrame(rtFrame, reflowStatus,
                                                      &metrics, pushedFrame);
+        NS_ASSERTION(!NS_INLINE_IS_BREAK(reflowStatus),
+                     "Ruby line breaking is not yet implemented");
         NS_ASSERTION(!pushedFrame, "Ruby line breaking is not yet implemented");
         pairISize = std::max(pairISize, metrics.ISize(lineWM));
       }
     }
 
     nsIFrame* rbFrame = e.GetBaseFrame();
     if (rbFrame) {
       MOZ_ASSERT(rbFrame->GetType() == nsGkAtoms::rubyBaseFrame);
       nsReflowStatus reflowStatus;
       nsHTMLReflowMetrics metrics(aReflowState);
 
       bool pushedFrame;
       aReflowState.mLineLayout->ReflowFrame(rbFrame, reflowStatus,
                                             &metrics, pushedFrame);
+      NS_ASSERTION(!NS_INLINE_IS_BREAK(reflowStatus),
+                   "Ruby line breaking is not yet implemented");
       NS_ASSERTION(!pushedFrame, "Ruby line breaking is not yet implemented");
       pairISize = std::max(pairISize, metrics.ISize(lineWM));
     }
 
     // Align all the line layout to the new coordinate.
     icoord += pairISize;
     aReflowState.mLineLayout->AdvanceICoord(
       icoord - aReflowState.mLineLayout->GetCurrentICoord());
@@ -328,16 +347,18 @@ nsRubyBaseContainerFrame::Reflow(nsPresC
   for (uint32_t i = 0; i < spanCount; i++) {
     nsRubyTextContainerFrame* container = mSpanContainers[i];
     nsIFrame* rtFrame = container->GetFirstPrincipalChild();
     nsReflowStatus reflowStatus;
     nsHTMLReflowMetrics metrics(*spanReflowStates[i]);
     bool pushedFrame;
     spanReflowStates[i]->mLineLayout->ReflowFrame(rtFrame, reflowStatus,
                                                   &metrics, pushedFrame);
+    NS_ASSERTION(!NS_INLINE_IS_BREAK(reflowStatus),
+                 "Ruby line breaking is not yet implemented");
     NS_ASSERTION(!pushedFrame, "Ruby line breaking is not yet implemented");
     spanISize = std::max(spanISize, metrics.ISize(lineWM));
   }
 
   nscoord isize = icoord - istart;
   if (isize < spanISize) {
     aReflowState.mLineLayout->AdvanceICoord(spanISize - isize);
     isize = spanISize;
--- a/layout/generic/nsRubyBaseContainerFrame.h
+++ b/layout/generic/nsRubyBaseContainerFrame.h
@@ -32,16 +32,25 @@ public:
   // nsIFrame overrides
   virtual nsIAtom* GetType() const MOZ_OVERRIDE;
   virtual bool IsFrameOfType(uint32_t aFlags) const MOZ_OVERRIDE;
   virtual bool CanContinueTextRun() const MOZ_OVERRIDE;
   virtual void AddInlineMinISize(nsRenderingContext *aRenderingContext,
                                  InlineMinISizeData *aData) MOZ_OVERRIDE;
   virtual void AddInlinePrefISize(nsRenderingContext *aRenderingContext,
                                   InlinePrefISizeData *aData) MOZ_OVERRIDE;
+  virtual mozilla::LogicalSize
+    ComputeSize(nsRenderingContext *aRenderingContext,
+                mozilla::WritingMode aWritingMode,
+                const mozilla::LogicalSize& aCBSize,
+                nscoord aAvailableISize,
+                const mozilla::LogicalSize& aMargin,
+                const mozilla::LogicalSize& aBorder,
+                const mozilla::LogicalSize& aPadding,
+                ComputeSizeFlags aFlags) MOZ_OVERRIDE;
   virtual void Reflow(nsPresContext* aPresContext,
                       nsHTMLReflowMetrics& aDesiredSize,
                       const nsHTMLReflowState& aReflowState,
                       nsReflowStatus& aStatus) MOZ_OVERRIDE;
 
 #ifdef DEBUG_FRAME_DUMP
   virtual nsresult GetFrameName(nsAString& aResult) const MOZ_OVERRIDE;
 #endif
--- a/layout/generic/nsRubyBaseFrame.cpp
+++ b/layout/generic/nsRubyBaseFrame.cpp
@@ -16,17 +16,17 @@ using namespace mozilla;
 
 //----------------------------------------------------------------------
 
 // Frame class boilerplate
 // =======================
 
 NS_QUERYFRAME_HEAD(nsRubyBaseFrame)
   NS_QUERYFRAME_ENTRY(nsRubyBaseFrame)
-NS_QUERYFRAME_TAIL_INHERITING(nsContainerFrame)
+NS_QUERYFRAME_TAIL_INHERITING(nsInlineFrame)
 
 NS_IMPL_FRAMEARENA_HELPERS(nsRubyBaseFrame)
 
 nsContainerFrame*
 NS_NewRubyBaseFrame(nsIPresShell* aPresShell,
                     nsStyleContext* aContext)
 {
   return new (aPresShell) nsRubyBaseFrame(aContext);
@@ -47,108 +47,16 @@ nsRubyBaseFrame::GetType() const
 #ifdef DEBUG_FRAME_DUMP
 nsresult
 nsRubyBaseFrame::GetFrameName(nsAString& aResult) const
 {
   return MakeFrameName(NS_LITERAL_STRING("RubyBase"), aResult);
 }
 #endif
 
-nscoord
-nsRubyBaseFrame::GetMinISize(nsRenderingContext *aRenderingContext)
-{
-  return nsLayoutUtils::MinISizeFromInline(this, aRenderingContext);
-}
-
-nscoord
-nsRubyBaseFrame::GetPrefISize(nsRenderingContext *aRenderingContext)
+/* virtual */ bool
+nsRubyBaseFrame::IsFrameOfType(uint32_t aFlags) const
 {
-  return nsLayoutUtils::PrefISizeFromInline(this, aRenderingContext);
-}
-
-/* virtual */ void
-nsRubyBaseFrame::AddInlineMinISize(nsRenderingContext *aRenderingContext,
-                                   nsIFrame::InlineMinISizeData *aData)
-{
-  for (nsFrameList::Enumerator e(PrincipalChildList()); !e.AtEnd(); e.Next()) {
-    e.get()->AddInlineMinISize(aRenderingContext, aData);
+  if (aFlags & eBidiInlineContainer) {
+    return false;
   }
-}
-
-/* virtual */ void
-nsRubyBaseFrame::AddInlinePrefISize(nsRenderingContext *aRenderingContext,
-                                    nsIFrame::InlinePrefISizeData *aData)
-{
-  for (nsFrameList::Enumerator e(PrincipalChildList()); !e.AtEnd(); e.Next()) {
-    e.get()->AddInlinePrefISize(aRenderingContext, aData);
-  }
-}
-
-/* virtual */ bool 
-nsRubyBaseFrame::IsFrameOfType(uint32_t aFlags) const 
-{
-  return nsContainerFrame::IsFrameOfType(aFlags & 
-         ~(nsIFrame::eLineParticipant));
-}
-
-/* virtual */ nscoord
-nsRubyBaseFrame::GetLogicalBaseline(WritingMode aWritingMode) const
-{
-  return mBaseline;
-}
-
-/* virtual */ bool
-nsRubyBaseFrame::CanContinueTextRun() const
-{
-  return true;
+  return nsRubyBaseFrameSuper::IsFrameOfType(aFlags);
 }
-
-/* virtual */ void
-nsRubyBaseFrame::Reflow(nsPresContext* aPresContext,
-                        nsHTMLReflowMetrics& aDesiredSize,
-                        const nsHTMLReflowState& aReflowState,
-                        nsReflowStatus& aStatus)
-{
-  DO_GLOBAL_REFLOW_COUNT("nsRubyBaseFrame");
-  DISPLAY_REFLOW(aPresContext, this, aReflowState, aDesiredSize, aStatus);
-  
-  if (!aReflowState.mLineLayout) {
-    NS_ASSERTION(aReflowState.mLineLayout,
-                 "No line layout provided to RubyBaseFrame reflow method.");
-    aStatus = NS_FRAME_COMPLETE;
-    return;
-  }
-
-  WritingMode lineWM = aReflowState.mLineLayout->GetWritingMode();
-  WritingMode frameWM = aReflowState.GetWritingMode();
-  aStatus = NS_FRAME_COMPLETE;
-  LogicalSize availSize(lineWM, aReflowState.AvailableWidth(),
-                        aReflowState.AvailableHeight());
-  LogicalMargin borderPadding = aReflowState.ComputedLogicalBorderPadding();
-
-  // Begin the span for the ruby base frame
-  nscoord availableISize = aReflowState.AvailableISize();
-  NS_ASSERTION(availableISize != NS_UNCONSTRAINEDSIZE,
-               "should no longer use available widths");
-  // Subtract off inline axis border+padding from availableISize
-  availableISize -= borderPadding.IStartEnd(frameWM);
-  aReflowState.mLineLayout->BeginSpan(this, &aReflowState,
-                                      borderPadding.IStart(frameWM),
-                                      availableISize, &mBaseline);
-
-  for (nsFrameList::Enumerator e(mFrames); !e.AtEnd(); e.Next()) {
-    nsReflowStatus frameReflowStatus;
-    nsHTMLReflowMetrics metrics(aReflowState, aDesiredSize.mFlags);
-
-    bool pushedFrame;
-    aReflowState.mLineLayout->ReflowFrame(e.get(), frameReflowStatus,
-                                          &metrics, pushedFrame);
-    NS_ASSERTION(!pushedFrame,
-                 "Ruby line breaking is not yet implemented");
-
-    e.get()->SetSize(LogicalSize(lineWM, metrics.ISize(lineWM),
-                                 metrics.BSize(lineWM)));
-  }
-
-  aDesiredSize.ISize(lineWM) = aReflowState.mLineLayout->EndSpan(this);
-  nsLayoutUtils::SetBSizeFromFontMetrics(this, aDesiredSize, aReflowState,
-                                         borderPadding, lineWM, frameWM);
-}
--- a/layout/generic/nsRubyBaseFrame.h
+++ b/layout/generic/nsRubyBaseFrame.h
@@ -4,53 +4,42 @@
  * version 2.0 (the "License"). You can obtain a copy of the License at
  * http://mozilla.org/MPL/2.0/. */
 
 /* rendering object for CSS "display: ruby-base" */
 
 #ifndef nsRubyBaseFrame_h___
 #define nsRubyBaseFrame_h___
 
-#include "nsContainerFrame.h"
+#include "nsInlineFrame.h"
+
+typedef nsInlineFrame nsRubyBaseFrameSuper;
 
 /**
  * Factory function.
  * @return a newly allocated nsRubyBaseFrame (infallible)
  */
 nsContainerFrame* NS_NewRubyBaseFrame(nsIPresShell* aPresShell,
                                       nsStyleContext* aContext);
 
-class nsRubyBaseFrame MOZ_FINAL : public nsContainerFrame
+class nsRubyBaseFrame MOZ_FINAL : public nsRubyBaseFrameSuper
 {
 public:
   NS_DECL_FRAMEARENA_HELPERS
   NS_DECL_QUERYFRAME_TARGET(nsRubyBaseFrame)
   NS_DECL_QUERYFRAME
 
   // nsIFrame overrides
   virtual nsIAtom* GetType() const MOZ_OVERRIDE;
-  virtual void AddInlineMinISize(nsRenderingContext *aRenderingContext,
-                                 InlineMinISizeData *aData) MOZ_OVERRIDE;
-  virtual void AddInlinePrefISize(nsRenderingContext *aRenderingContext,
-                                  InlinePrefISizeData *aData) MOZ_OVERRIDE;
-  virtual nscoord GetMinISize(nsRenderingContext *aRenderingContext) MOZ_OVERRIDE;
-  virtual nscoord GetPrefISize(nsRenderingContext *aRenderingContext);
-  virtual void Reflow(nsPresContext* aPresContext,
-                      nsHTMLReflowMetrics& aDesiredSize,
-                      const nsHTMLReflowState& aReflowState,
-                      nsReflowStatus& aStatus) MOZ_OVERRIDE;
   virtual bool IsFrameOfType(uint32_t aFlags) const MOZ_OVERRIDE;
-  virtual nscoord GetLogicalBaseline(mozilla::WritingMode aWritingMode)
-    const MOZ_OVERRIDE;
-  virtual bool CanContinueTextRun() const MOZ_OVERRIDE;
 
 #ifdef DEBUG_FRAME_DUMP
   virtual nsresult GetFrameName(nsAString& aResult) const MOZ_OVERRIDE;
 #endif
 
 protected:
   friend nsContainerFrame* NS_NewRubyBaseFrame(nsIPresShell* aPresShell,
                                                nsStyleContext* aContext);
-  explicit nsRubyBaseFrame(nsStyleContext* aContext) : nsContainerFrame(aContext) {}
-  nscoord mBaseline;
+  explicit nsRubyBaseFrame(nsStyleContext* aContext)
+    : nsRubyBaseFrameSuper(aContext) {}
 };
 
 #endif /* nsRubyBaseFrame_h___ */
--- a/layout/generic/nsRubyFrame.cpp
+++ b/layout/generic/nsRubyFrame.cpp
@@ -182,16 +182,30 @@ nsRubyFrame::AddInlinePrefISize(nsRender
   nscoord sum = 0;
   for (SegmentEnumerator e(this); !e.AtEnd(); e.Next()) {
     AutoSetTextContainers holder(e.GetBaseContainer());
     sum += e.GetBaseContainer()->GetPrefISize(aRenderingContext);
   }
   aData->currentLine += sum;
 }
 
+/* virtual */ LogicalSize
+nsRubyFrame::ComputeSize(nsRenderingContext *aRenderingContext,
+                           WritingMode aWM,
+                           const LogicalSize& aCBSize,
+                           nscoord aAvailableISize,
+                           const LogicalSize& aMargin,
+                           const LogicalSize& aBorder,
+                           const LogicalSize& aPadding,
+                           ComputeSizeFlags aFlags)
+{
+  // Ruby frame is inline, hence don't compute size before reflow.
+  return LogicalSize(aWM, NS_UNCONSTRAINEDSIZE, NS_UNCONSTRAINEDSIZE);
+}
+
 /* virtual */ nscoord
 nsRubyFrame::GetLogicalBaseline(WritingMode aWritingMode) const
 {
   return mBaseline;
 }
 
 /* virtual */ bool
 nsRubyFrame::CanContinueTextRun() const
--- a/layout/generic/nsRubyFrame.h
+++ b/layout/generic/nsRubyFrame.h
@@ -27,16 +27,25 @@ public:
 
   // nsIFrame overrides
   virtual nsIAtom* GetType() const MOZ_OVERRIDE;
   virtual bool IsFrameOfType(uint32_t aFlags) const MOZ_OVERRIDE;
   virtual void AddInlineMinISize(nsRenderingContext *aRenderingContext,
                                  InlineMinISizeData *aData) MOZ_OVERRIDE;
   virtual void AddInlinePrefISize(nsRenderingContext *aRenderingContext,
                                   InlinePrefISizeData *aData) MOZ_OVERRIDE;
+  virtual mozilla::LogicalSize
+    ComputeSize(nsRenderingContext *aRenderingContext,
+                mozilla::WritingMode aWritingMode,
+                const mozilla::LogicalSize& aCBSize,
+                nscoord aAvailableISize,
+                const mozilla::LogicalSize& aMargin,
+                const mozilla::LogicalSize& aBorder,
+                const mozilla::LogicalSize& aPadding,
+                ComputeSizeFlags aFlags) MOZ_OVERRIDE;
   virtual void Reflow(nsPresContext* aPresContext,
                       nsHTMLReflowMetrics& aDesiredSize,
                       const nsHTMLReflowState& aReflowState,
                       nsReflowStatus& aStatus) MOZ_OVERRIDE;
   virtual nscoord GetLogicalBaseline(mozilla::WritingMode aWritingMode)
     const MOZ_OVERRIDE;
   virtual bool CanContinueTextRun() const MOZ_OVERRIDE;
 
--- a/layout/generic/nsRubyTextContainerFrame.cpp
+++ b/layout/generic/nsRubyTextContainerFrame.cpp
@@ -47,16 +47,25 @@ nsRubyTextContainerFrame::GetType() cons
 #ifdef DEBUG_FRAME_DUMP
 nsresult
 nsRubyTextContainerFrame::GetFrameName(nsAString& aResult) const
 {
   return MakeFrameName(NS_LITERAL_STRING("RubyTextContainer"), aResult);
 }
 #endif
 
+/* virtual */ bool
+nsRubyTextContainerFrame::IsFrameOfType(uint32_t aFlags) const
+{
+  if (aFlags & eSupportsCSSTransforms) {
+    return false;
+  }
+  return nsRubyTextContainerFrameSuper::IsFrameOfType(aFlags);
+}
+
 /* virtual */ void
 nsRubyTextContainerFrame::Reflow(nsPresContext* aPresContext,
                                  nsHTMLReflowMetrics& aDesiredSize,
                                  const nsHTMLReflowState& aReflowState,
                                  nsReflowStatus& aStatus)
 {
   DO_GLOBAL_REFLOW_COUNT("nsRubyTextContainerFrame");
   DISPLAY_REFLOW(aPresContext, this, aReflowState, aDesiredSize, aStatus);
--- a/layout/generic/nsRubyTextContainerFrame.h
+++ b/layout/generic/nsRubyTextContainerFrame.h
@@ -9,48 +9,51 @@
 #ifndef nsRubyTextContainerFrame_h___
 #define nsRubyTextContainerFrame_h___
 
 #include "nsBlockFrame.h"
 #include "nsRubyBaseFrame.h"
 #include "nsRubyTextFrame.h"
 #include "nsLineLayout.h"
 
+typedef nsContainerFrame nsRubyTextContainerFrameSuper;
+
 /**
  * Factory function.
  * @return a newly allocated nsRubyTextContainerFrame (infallible)
  */
 nsContainerFrame* NS_NewRubyTextContainerFrame(nsIPresShell* aPresShell,
                                                nsStyleContext* aContext);
 
-class nsRubyTextContainerFrame MOZ_FINAL : public nsContainerFrame
+class nsRubyTextContainerFrame MOZ_FINAL : public nsRubyTextContainerFrameSuper
 {
 public:
   NS_DECL_FRAMEARENA_HELPERS
   NS_DECL_QUERYFRAME_TARGET(nsRubyTextContainerFrame)
   NS_DECL_QUERYFRAME
 
   // nsIFrame overrides
   virtual nsIAtom* GetType() const MOZ_OVERRIDE;
+  virtual bool IsFrameOfType(uint32_t aFlags) const MOZ_OVERRIDE;
   virtual void Reflow(nsPresContext* aPresContext,
                       nsHTMLReflowMetrics& aDesiredSize,
                       const nsHTMLReflowState& aReflowState,
                       nsReflowStatus& aStatus) MOZ_OVERRIDE;
 
 #ifdef DEBUG_FRAME_DUMP
   virtual nsresult GetFrameName(nsAString& aResult) const MOZ_OVERRIDE;
 #endif
   void SetISize(nscoord aISize) { mISize = aISize; }
 
 protected:
   friend nsContainerFrame*
     NS_NewRubyTextContainerFrame(nsIPresShell* aPresShell,
                                  nsStyleContext* aContext);
   explicit nsRubyTextContainerFrame(nsStyleContext* aContext)
-    : nsContainerFrame(aContext) {}
+    : nsRubyTextContainerFrameSuper(aContext) {}
 
   // The intended dimensions of the ruby text container. These are modified
   // whenever a ruby text box is reflowed and used when the ruby text container
   // is reflowed.
   nscoord mISize;
 };
 
 #endif /* nsRubyTextContainerFrame_h___ */
--- a/layout/generic/nsRubyTextFrame.cpp
+++ b/layout/generic/nsRubyTextFrame.cpp
@@ -16,17 +16,17 @@ using namespace mozilla;
 
 //----------------------------------------------------------------------
 
 // Frame class boilerplate
 // =======================
 
 NS_QUERYFRAME_HEAD(nsRubyTextFrame)
   NS_QUERYFRAME_ENTRY(nsRubyTextFrame)
-NS_QUERYFRAME_TAIL_INHERITING(nsContainerFrame)
+NS_QUERYFRAME_TAIL_INHERITING(nsInlineFrame)
 
 NS_IMPL_FRAMEARENA_HELPERS(nsRubyTextFrame)
 
 nsContainerFrame*
 NS_NewRubyTextFrame(nsIPresShell* aPresShell,
                     nsStyleContext* aContext)
 {
   return new (aPresShell) nsRubyTextFrame(aContext);
@@ -47,102 +47,16 @@ nsRubyTextFrame::GetType() const
 #ifdef DEBUG_FRAME_DUMP
 nsresult
 nsRubyTextFrame::GetFrameName(nsAString& aResult) const
 {
   return MakeFrameName(NS_LITERAL_STRING("RubyText"), aResult);
 }
 #endif
 
-/* virtual */ bool 
-nsRubyTextFrame::IsFrameOfType(uint32_t aFlags) const 
-{
-  return nsContainerFrame::IsFrameOfType(aFlags & 
-         ~(nsIFrame::eLineParticipant));
-}
-
-/* virtual */ nscoord
-nsRubyTextFrame::GetMinISize(nsRenderingContext *aRenderingContext)
-{
-  return nsLayoutUtils::MinISizeFromInline(this, aRenderingContext);
-}
-
-/* virtual */ nscoord
-nsRubyTextFrame::GetPrefISize(nsRenderingContext *aRenderingContext)
+/* virtual */ bool
+nsRubyTextFrame::IsFrameOfType(uint32_t aFlags) const
 {
-  return nsLayoutUtils::PrefISizeFromInline(this, aRenderingContext);
-}
-
-/* virtual */ void
-nsRubyTextFrame::AddInlineMinISize(nsRenderingContext *aRenderingContext,
-                                   nsIFrame::InlineMinISizeData *aData)
-{
-  for (nsFrameList::Enumerator e(PrincipalChildList()); !e.AtEnd(); e.Next()) {
-    e.get()->AddInlineMinISize(aRenderingContext, aData);
+  if (aFlags & eBidiInlineContainer) {
+    return false;
   }
-}
-
-/* virtual */ void
-nsRubyTextFrame::AddInlinePrefISize(nsRenderingContext *aRenderingContext,
-                                    nsIFrame::InlinePrefISizeData *aData)
-{
-  for (nsFrameList::Enumerator e(PrincipalChildList()); !e.AtEnd(); e.Next()) {
-    e.get()->AddInlinePrefISize(aRenderingContext, aData);
-  }
-}
-
-/* virtual */ nscoord
-nsRubyTextFrame::GetLogicalBaseline(WritingMode aWritingMode) const
-{
-  return mBaseline;
+  return nsRubyTextFrameSuper::IsFrameOfType(aFlags);
 }
-
-/* virtual */ void
-nsRubyTextFrame::Reflow(nsPresContext* aPresContext,
-                        nsHTMLReflowMetrics& aDesiredSize,
-                        const nsHTMLReflowState& aReflowState,
-                        nsReflowStatus& aStatus)
-{
-  DO_GLOBAL_REFLOW_COUNT("nsRubyBaseFrame");
-  DISPLAY_REFLOW(aPresContext, this, aReflowState, aDesiredSize, aStatus);
-  
-  if (!aReflowState.mLineLayout) {
-    NS_ASSERTION(aReflowState.mLineLayout,
-                 "No line layout provided to RubyTextFrame reflow method.");
-    aStatus = NS_FRAME_COMPLETE;
-    return;
-  }
-
-  WritingMode lineWM = aReflowState.mLineLayout->GetWritingMode();
-  WritingMode frameWM = aReflowState.GetWritingMode();
-  LogicalMargin borderPadding = aReflowState.ComputedLogicalBorderPadding();
-  aStatus = NS_FRAME_COMPLETE;
-  LogicalSize availSize(lineWM, aReflowState.AvailableWidth(),
-                        aReflowState.AvailableHeight());
-
-  // Begin the span for the ruby text frame
-  nscoord availableISize = aReflowState.AvailableISize();
-  NS_ASSERTION(availableISize != NS_UNCONSTRAINEDSIZE,
-               "should no longer use available widths");
-  // Subtract off inline axis border+padding from availableISize
-  availableISize -= borderPadding.IStartEnd(frameWM);
-  aReflowState.mLineLayout->BeginSpan(this, &aReflowState,
-                                      borderPadding.IStart(frameWM),
-                                      availableISize, &mBaseline);
-
-  for (nsFrameList::Enumerator e(mFrames); !e.AtEnd(); e.Next()) {
-    nsReflowStatus frameReflowStatus;
-    nsHTMLReflowMetrics metrics(aReflowState, aDesiredSize.mFlags);
-
-    bool pushedFrame;
-    aReflowState.mLineLayout->ReflowFrame(e.get(), frameReflowStatus,
-                                          &metrics, pushedFrame);
-    NS_ASSERTION(!pushedFrame,
-                 "Ruby line breaking is not yet implemented");
-    e.get()->SetSize(LogicalSize(lineWM, metrics.ISize(lineWM),
-                                 metrics.BSize(lineWM)));
-  }
-
-  aDesiredSize.ISize(lineWM) = aReflowState.mLineLayout->EndSpan(this);
-  nsLayoutUtils::SetBSizeFromFontMetrics(this, aDesiredSize, aReflowState,
-                                         borderPadding, lineWM, frameWM);
-
-}
--- a/layout/generic/nsRubyTextFrame.h
+++ b/layout/generic/nsRubyTextFrame.h
@@ -4,52 +4,42 @@
  * version 2.0 (the "License"). You can obtain a copy of the License at
  * http://mozilla.org/MPL/2.0/. */
 
 /* rendering object for CSS "display: ruby-text" */
 
 #ifndef nsRubyTextFrame_h___
 #define nsRubyTextFrame_h___
 
-#include "nsContainerFrame.h"
+#include "nsInlineFrame.h"
+
+typedef nsInlineFrame nsRubyTextFrameSuper;
 
 /**
  * Factory function.
  * @return a newly allocated nsRubyTextFrame (infallible)
  */
 nsContainerFrame* NS_NewRubyTextFrame(nsIPresShell* aPresShell,
                                       nsStyleContext* aContext);
 
-class nsRubyTextFrame MOZ_FINAL : public nsContainerFrame
+class nsRubyTextFrame MOZ_FINAL : public nsRubyTextFrameSuper
 {
 public:
   NS_DECL_FRAMEARENA_HELPERS
   NS_DECL_QUERYFRAME_TARGET(nsRubyTextFrame)
   NS_DECL_QUERYFRAME
 
   // nsIFrame overrides
   virtual nsIAtom* GetType() const MOZ_OVERRIDE;
-  virtual void Reflow(nsPresContext* aPresContext,
-                      nsHTMLReflowMetrics& aDesiredSize,
-                      const nsHTMLReflowState& aReflowState,
-                      nsReflowStatus& aStatus) MOZ_OVERRIDE;
   virtual bool IsFrameOfType(uint32_t aFlags) const MOZ_OVERRIDE;
-  virtual void AddInlineMinISize(nsRenderingContext *aRenderingContext,
-                                 InlineMinISizeData *aData) MOZ_OVERRIDE;
-  virtual void AddInlinePrefISize(nsRenderingContext *aRenderingContext,
-                                  InlinePrefISizeData *aData) MOZ_OVERRIDE;
-  virtual nscoord GetMinISize(nsRenderingContext *aRenderingContext) MOZ_OVERRIDE;
-  virtual nscoord GetPrefISize(nsRenderingContext *aRenderingContext) MOZ_OVERRIDE;
-  virtual nscoord GetLogicalBaseline(mozilla::WritingMode aWritingMode)
-    const MOZ_OVERRIDE;
 
 #ifdef DEBUG_FRAME_DUMP
   virtual nsresult GetFrameName(nsAString& aResult) const MOZ_OVERRIDE;
 #endif
 
 protected:
   friend nsContainerFrame* NS_NewRubyTextFrame(nsIPresShell* aPresShell,
                                                nsStyleContext* aContext);
-  explicit nsRubyTextFrame(nsStyleContext* aContext) : nsContainerFrame(aContext) {}
-  nscoord mBaseline;
+  explicit nsRubyTextFrame(nsStyleContext* aContext)
+    : nsRubyTextFrameSuper(aContext) {}
 };
 
 #endif /* nsRubyTextFrame_h___ */