Bug 1181087 - part 2 - Remove the unused physical setter methods on logical-coordinate classes. r=smontagu
authorJonathan Kew <jkew@mozilla.com>
Tue, 07 Jul 2015 14:20:09 +0100
changeset 251699 e3ef946cce23301605ea1bd15c7e6ae7e4ee958c
parent 251698 e70e937ae75bf355bf58575601a4ccf6c6f0c1df
child 251700 3ff251da4daec54695d91113b01c9b4e7f451142
push id61931
push userjkew@mozilla.com
push dateTue, 07 Jul 2015 13:32:48 +0000
treeherdermozilla-inbound@e3ef946cce23 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssmontagu
bugs1181087
milestone42.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 1181087 - part 2 - Remove the unused physical setter methods on logical-coordinate classes. r=smontagu
layout/generic/WritingModes.h
--- a/layout/generic/WritingModes.h
+++ b/layout/generic/WritingModes.h
@@ -700,38 +700,16 @@ public:
   }
   nscoord& B(WritingMode aWritingMode) // block-axis
   {
     CHECK_WRITING_MODE(aWritingMode);
     return mPoint.y;
   }
 
   /**
-   * Setters for the physical coordinates.
-   */
-  void SetX(WritingMode aWritingMode, nscoord aX, nscoord aContainerWidth)
-  {
-    CHECK_WRITING_MODE(aWritingMode);
-    if (aWritingMode.IsVertical()) {
-      B() = aWritingMode.IsVerticalLR() ? aX : aContainerWidth - aX;
-    } else {
-      I() = aWritingMode.IsBidiLTR() ? aX : aContainerWidth - aX;
-    }
-  }
-  void SetY(WritingMode aWritingMode, nscoord aY)
-  {
-    CHECK_WRITING_MODE(aWritingMode);
-    if (aWritingMode.IsVertical()) {
-      I() = aY;
-    } else {
-      B() = aY;
-    }
-  }
-
-  /**
    * Return a physical point corresponding to our logical coordinates,
    * converted according to our writing mode.
    */
   nsPoint GetPhysicalPoint(WritingMode aWritingMode,
                            nscoord aContainerWidth) const
   {
     CHECK_WRITING_MODE(aWritingMode);
     if (aWritingMode.IsVertical()) {
@@ -924,40 +902,29 @@ public:
   }
   nscoord Height(WritingMode aWritingMode) const
   {
     CHECK_WRITING_MODE(aWritingMode);
     return aWritingMode.IsVertical() ? ISize() : BSize();
   }
 
   /**
-   * Writable references to the logical and physical dimensions
+   * Writable references to the logical dimensions
    */
   nscoord& ISize(WritingMode aWritingMode) // inline-size
   {
     CHECK_WRITING_MODE(aWritingMode);
     return mSize.width;
   }
   nscoord& BSize(WritingMode aWritingMode) // block-size
   {
     CHECK_WRITING_MODE(aWritingMode);
     return mSize.height;
   }
 
-  nscoord& Width(WritingMode aWritingMode)
-  {
-    CHECK_WRITING_MODE(aWritingMode);
-    return aWritingMode.IsVertical() ? BSize() : ISize();
-  }
-  nscoord& Height(WritingMode aWritingMode)
-  {
-    CHECK_WRITING_MODE(aWritingMode);
-    return aWritingMode.IsVertical() ? ISize() : BSize();
-  }
-
   /**
    * Return an nsSize containing our physical dimensions
    */
   nsSize GetPhysicalSize(WritingMode aWritingMode) const
   {
     CHECK_WRITING_MODE(aWritingMode);
     return aWritingMode.IsVertical() ?
       nsSize(BSize(), ISize()) : nsSize(ISize(), BSize());
@@ -1236,46 +1203,16 @@ public:
 
   void SizeTo(WritingMode aWritingMode,
               nscoord aBStart, nscoord aIEnd, nscoord aBEnd, nscoord aIStart)
   {
     CHECK_WRITING_MODE(aWritingMode);
     mMargin.SizeTo(aBStart, aIEnd, aBEnd, aIStart);
   }
 
-  nscoord& Top(WritingMode aWritingMode)
-  {
-    CHECK_WRITING_MODE(aWritingMode);
-    return aWritingMode.IsVertical() ?
-      (aWritingMode.IsBidiLTR() ? IStart() : IEnd()) : BStart();
-  }
-
-  nscoord& Bottom(WritingMode aWritingMode)
-  {
-    CHECK_WRITING_MODE(aWritingMode);
-    return aWritingMode.IsVertical() ?
-      (aWritingMode.IsBidiLTR() ? IEnd() : IStart()) : BEnd();
-  }
-
-  nscoord& Left(WritingMode aWritingMode)
-  {
-    CHECK_WRITING_MODE(aWritingMode);
-    return aWritingMode.IsVertical() ?
-      (aWritingMode.IsVerticalLR() ? BStart() : BEnd()) :
-      (aWritingMode.IsBidiLTR() ? IStart() : IEnd());
-  }
-
-  nscoord& Right(WritingMode aWritingMode)
-  {
-    CHECK_WRITING_MODE(aWritingMode);
-    return aWritingMode.IsVertical() ?
-      (aWritingMode.IsVerticalLR() ? BEnd() : BStart()) :
-      (aWritingMode.IsBidiLTR() ? IEnd() : IStart());
-  }
-
   /**
    * Return an nsMargin containing our physical coordinates
    */
   nsMargin GetPhysicalMargin(WritingMode aWritingMode) const
   {
     CHECK_WRITING_MODE(aWritingMode);
     return aWritingMode.IsVertical()
       ? (aWritingMode.IsVerticalLR()
@@ -1566,91 +1503,34 @@ public:
       return aWritingMode.IsVerticalLR() ?
              mRect.Y() : aContainerWidth - mRect.YMost();
     } else {
       return aWritingMode.IsBidiLTR() ?
              mRect.X() : aContainerWidth - mRect.XMost();
     }
   }
 
-  void SetX(WritingMode aWritingMode, nscoord aX, nscoord aContainerWidth)
-  {
-    CHECK_WRITING_MODE(aWritingMode);
-    if (aWritingMode.IsVertical()) {
-      if (aWritingMode.IsVerticalLR()) {
-        BStart() = aX;
-      } else {
-        BStart() = aContainerWidth - aX - BSize();
-      }
-    } else {
-      if (aWritingMode.IsBidiLTR()) {
-        IStart() = aX;
-      } else {
-        IStart() = aContainerWidth - aX - ISize();
-      }
-    }
-  }
-
   nscoord Y(WritingMode aWritingMode) const
   {
     CHECK_WRITING_MODE(aWritingMode);
     return aWritingMode.IsVertical() ? mRect.X() : mRect.Y();
   }
 
-  void SetY(WritingMode aWritingMode, nscoord aY)
-  {
-    CHECK_WRITING_MODE(aWritingMode);
-    if (aWritingMode.IsVertical()) {
-      IStart() = aY;
-    } else {
-      BStart() = aY;
-    }
-  }
-
   nscoord Width(WritingMode aWritingMode) const
   {
     CHECK_WRITING_MODE(aWritingMode);
     return aWritingMode.IsVertical() ? mRect.Height() : mRect.Width();
   }
 
-  // When setting the Width of a rect, we keep its physical X-coord fixed
-  // and modify XMax. This means that in the RTL case, we'll be moving
-  // the IStart, so that IEnd remains constant.
-  void SetWidth(WritingMode aWritingMode, nscoord aWidth)
-  {
-    CHECK_WRITING_MODE(aWritingMode);
-    if (aWritingMode.IsVertical()) {
-      if (!aWritingMode.IsVerticalLR()) {
-        BStart() = BStart() + BSize() - aWidth;
-      }
-      BSize() = aWidth;
-    } else {
-      if (!aWritingMode.IsBidiLTR()) {
-        IStart() = IStart() + ISize() - aWidth;
-      }
-      ISize() = aWidth;
-    }
-  }
-
   nscoord Height(WritingMode aWritingMode) const
   {
     CHECK_WRITING_MODE(aWritingMode);
     return aWritingMode.IsVertical() ? mRect.Width() : mRect.Height();
   }
 
-  void SetHeight(WritingMode aWritingMode, nscoord aHeight)
-  {
-    CHECK_WRITING_MODE(aWritingMode);
-    if (aWritingMode.IsVertical()) {
-      ISize() = aHeight;
-    } else {
-      BSize() = aHeight;
-    }
-  }
-
   nscoord XMost(WritingMode aWritingMode, nscoord aContainerWidth) const
   {
     CHECK_WRITING_MODE(aWritingMode);
     if (aWritingMode.IsVertical()) {
       return aWritingMode.IsVerticalLR() ?
              mRect.YMost() : aContainerWidth - mRect.Y();
     } else {
       return aWritingMode.IsBidiLTR() ?