Bug 1062735 - Part 3: Change ReduceRectToVerticalEdge to 1 css pixel instead of 1 app unit. r=roc
authorMorris Tseng <mtseng@mozilla.com>
Sun, 28 Sep 2014 23:50:00 +0200
changeset 210996 0d49c600a6d592795ccf3bb111e1106d6d2a5fe9
parent 210995 fe11070e6932f219bf7be979b195bdccbce7f956
child 210997 6a1757feb3ff387a3c852ae7a0106902fd0f1c55
push id1
push userroot
push dateMon, 20 Oct 2014 17:29:22 +0000
reviewersroc
bugs1062735
milestone36.0a1
Bug 1062735 - Part 3: Change ReduceRectToVerticalEdge to 1 css pixel instead of 1 app unit. r=roc
layout/base/SelectionCarets.cpp
--- a/layout/base/SelectionCarets.cpp
+++ b/layout/base/SelectionCarets.cpp
@@ -295,26 +295,26 @@ IsRightToLeft(nsIFrame* aFrame)
   MOZ_ASSERT(aFrame);
 
   return aFrame->IsFrameOfType(nsIFrame::eLineParticipant) ?
     (nsBidiPresUtils::GetFrameEmbeddingLevel(aFrame) & 1) :
     aFrame->StyleVisibility()->mDirection == NS_STYLE_DIRECTION_RTL;
 }
 
 /*
- * Reduce rect to 1 app unit width along either left or right edge base on
+ * Reduce rect to 1 css pixel width along either left or right edge base on
  * aToRightEdge parameter.
  */
 static void
 ReduceRectToVerticalEdge(nsRect& aRect, bool aToRightEdge)
 {
   if (aToRightEdge) {
-    aRect.x = aRect.XMost() - 1;
+    aRect.x = aRect.XMost() - AppUnitsPerCSSPixel();
   }
-  aRect.width = 1;
+  aRect.width = AppUnitsPerCSSPixel();
 }
 
 static nsIFrame*
 FindFirstNodeWithFrame(nsIDocument* aDocument,
                        nsRange* aRange,
                        nsFrameSelection* aFrameSelection,
                        bool aBackward,
                        int& aOutOffset)