Bug 1048752. Part 7: Remove mCaretWidthCSSPx. r=tn

mCaretWidthCSSPx doesn't need to be stored. We can just recompute it
whenever we need it.

--HG--
extra : rebase_source : 850b556651afade0da543e281e5fa54235969ab4
This commit is contained in:
Robert O'Callahan 2014-08-06 17:19:25 +12:00
Родитель 3b04ddd57d
Коммит fb59918a6c
2 изменённых файлов: 2 добавлений и 3 удалений

Просмотреть файл

@ -141,7 +141,6 @@ nsresult nsCaret::Init(nsIPresShell *inPresShell)
// XXX we should just do this LookAndFeel consultation every time
// we need these values.
mCaretWidthCSSPx = LookAndFeel::GetInt(LookAndFeel::eIntID_CaretWidth, 1);
mCaretAspectRatio =
LookAndFeel::GetFloat(LookAndFeel::eFloatID_CaretAspectRatio, 0.0f);
@ -197,7 +196,8 @@ nsCaret::Metrics nsCaret::ComputeMetrics(nsIFrame* aFrame, int32_t aOffset, nsco
{
// Compute nominal sizes in appunits
nscoord caretWidth = (aCaretHeight * mCaretAspectRatio) +
nsPresContext::CSSPixelsToAppUnits(mCaretWidthCSSPx);
nsPresContext::CSSPixelsToAppUnits(
LookAndFeel::GetInt(LookAndFeel::eIntID_CaretWidth, 1));
if (DrawCJKCaret(aFrame, aOffset)) {
caretWidth += nsPresContext::CSSPixelsToAppUnits(1);

Просмотреть файл

@ -202,7 +202,6 @@ protected:
// XXX these fields should go away and the values be acquired as needed,
// probably by ComputeMetrics.
uint32_t mBlinkRate; // time for one cyle (on then off), in milliseconds
nscoord mCaretWidthCSSPx; // caret width in CSS pixels
float mCaretAspectRatio; // caret width/height aspect ratio
bool mVisible; // is the caret blinking