From c42496f47f699f054225588734bba44616319f37 Mon Sep 17 00:00:00 2001 From: Ehsan Akhgari Date: Wed, 19 Jan 2011 16:09:50 -0500 Subject: [PATCH] Backed out changeset 3fc6728e81a8 because of Windows 7 orange --- layout/base/nsCaret.cpp | 13 ++++--------- layout/base/nsCaret.h | 1 - .../reftests/editor/caret_on_input_edge-ref.html | 6 ------ layout/reftests/editor/caret_on_input_edge.html | 14 -------------- layout/reftests/editor/reftest.list | 1 - 5 files changed, 4 insertions(+), 31 deletions(-) delete mode 100644 layout/reftests/editor/caret_on_input_edge-ref.html delete mode 100644 layout/reftests/editor/caret_on_input_edge.html diff --git a/layout/base/nsCaret.cpp b/layout/base/nsCaret.cpp index a2c28ef9f5f..59f217a879a 100644 --- a/layout/base/nsCaret.cpp +++ b/layout/base/nsCaret.cpp @@ -260,10 +260,10 @@ nsCaret::Metrics nsCaret::ComputeMetrics(nsIFrame* aFrame, PRInt32 aOffset, nsco // Round them to device pixels. Always round down, except that anything // between 0 and 1 goes up to 1 so we don't let the caret disappear. + PRUint32 tpp = aFrame->PresContext()->AppUnitsPerDevPixel(); Metrics result; - result.mAppPerDev = aFrame->PresContext()->AppUnitsPerDevPixel(); - result.mCaretWidth = NS_ROUND_BORDER_TO_PIXELS(caretWidth, result.mAppPerDev); - result.mBidiIndicatorSize = NS_ROUND_BORDER_TO_PIXELS(bidiIndicatorSize, result.mAppPerDev); + result.mCaretWidth = NS_ROUND_BORDER_TO_PIXELS(caretWidth, tpp); + result.mBidiIndicatorSize = NS_ROUND_BORDER_TO_PIXELS(bidiIndicatorSize, tpp); return result; } @@ -383,13 +383,8 @@ nsCaret::GetGeometryForFrame(nsIFrame* aFrame, // then snap it back, put it as close to the edge as it can. nscoord overflow = caretInScroll.XMost() - scrolled->GetVisualOverflowRectRelativeToSelf().width; - if (overflow > 0) { + if (overflow > 0) aRect->x -= overflow; - // Make sure that the caret falls on a device pixel boundary so that - // it doesn't fall outside of the view. We round the X coordinate - // down to the nearest device pixel unit. - aRect->x = floor(double(aRect->x) / caretMetrics.mAppPerDev) * caretMetrics.mAppPerDev; - } } if (aBidiIndicatorSize) diff --git a/layout/base/nsCaret.h b/layout/base/nsCaret.h index fdce100d27f..4ae582c8a52 100644 --- a/layout/base/nsCaret.h +++ b/layout/base/nsCaret.h @@ -215,7 +215,6 @@ protected: struct Metrics { nscoord mBidiIndicatorSize; // width and height of bidi indicator nscoord mCaretWidth; // full caret width including bidi indicator - PRUint32 mAppPerDev; // App units per device units metric }; Metrics ComputeMetrics(nsIFrame* aFrame, PRInt32 aOffset, nscoord aCaretHeight); nsresult GetGeometryForFrame(nsIFrame* aFrame, diff --git a/layout/reftests/editor/caret_on_input_edge-ref.html b/layout/reftests/editor/caret_on_input_edge-ref.html deleted file mode 100644 index 7c09b19ab04..00000000000 --- a/layout/reftests/editor/caret_on_input_edge-ref.html +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/layout/reftests/editor/caret_on_input_edge.html b/layout/reftests/editor/caret_on_input_edge.html deleted file mode 100644 index 754b9bb1dae..00000000000 --- a/layout/reftests/editor/caret_on_input_edge.html +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - diff --git a/layout/reftests/editor/reftest.list b/layout/reftests/editor/reftest.list index 29ab606f8eb..36b47f3d2f0 100644 --- a/layout/reftests/editor/reftest.list +++ b/layout/reftests/editor/reftest.list @@ -47,4 +47,3 @@ asserts(1) == passwd-4.html passwd-ref.html # bug 596901 == caret_after_reframe.html caret_after_reframe-ref.html == nobogusnode-1.html nobogusnode-ref.html == nobogusnode-2.html nobogusnode-ref.html -== caret_on_input_edge.html caret_on_input_edge-ref.html