diff --git a/layout/forms/nsTextControlFrame.cpp b/layout/forms/nsTextControlFrame.cpp index e9b81d91f87f..313c397e06e0 100644 --- a/layout/forms/nsTextControlFrame.cpp +++ b/layout/forms/nsTextControlFrame.cpp @@ -100,7 +100,7 @@ private: nsTextControlFrame::nsTextControlFrame(nsIPresShell* aShell, nsStyleContext* aContext) : nsContainerFrame(aContext) - , mUseEditor(false) + , mEditorHasBeenInitialized(false) , mIsProcessing(false) #ifdef DEBUG , mInEditorInitialization(false) @@ -253,9 +253,7 @@ nsTextControlFrame::EnsureEditorInitialized() // never get used. So, now this method is being called lazily only // when we actually need an editor. - // Check if this method has been called already. - // If so, just return early. - if (mUseEditor) + if (mEditorHasBeenInitialized) return NS_OK; nsIDocument* doc = mContent->GetCurrentDoc(); @@ -308,9 +306,9 @@ nsTextControlFrame::EnsureEditorInitialized() NS_ENSURE_SUCCESS(rv, rv); NS_ENSURE_STATE(weakFrame.IsAlive()); - // Turn on mUseEditor so that subsequent calls will use the + // Set mEditorHasBeenInitialized so that subsequent calls will use the // editor. - mUseEditor = true; + mEditorHasBeenInitialized = true; // Set the selection to the beginning of the text field. if (weakFrame.IsAlive()) { @@ -1138,7 +1136,7 @@ nsTextControlFrame::AttributeChanged(int32_t aNameSpaceID, return NS_OK; } - if (!mUseEditor && nsGkAtoms::value == aAttribute) { + if (!mEditorHasBeenInitialized && nsGkAtoms::value == aAttribute) { UpdateValueDisplay(true); return NS_OK; } @@ -1280,7 +1278,7 @@ nsTextControlFrame::UpdateValueDisplay(bool aNotify, nsIContent* rootNode = txtCtrl->GetRootEditorNode(); NS_PRECONDITION(rootNode, "Must have a div content\n"); - NS_PRECONDITION(!mUseEditor, + NS_PRECONDITION(!mEditorHasBeenInitialized, "Do not call this after editor has been initialized"); NS_ASSERTION(!mUsePlaceholder || txtCtrl->GetPlaceholderNode(), "A placeholder div must exist"); diff --git a/layout/forms/nsTextControlFrame.h b/layout/forms/nsTextControlFrame.h index 38e54e4d7ff1..57c154a82fb4 100644 --- a/layout/forms/nsTextControlFrame.h +++ b/layout/forms/nsTextControlFrame.h @@ -301,7 +301,7 @@ private: private: // these packed bools could instead use the high order bits on mState, saving 4 bytes - bool mUseEditor; + bool mEditorHasBeenInitialized; bool mIsProcessing; // Keep track if we have asked a placeholder node creation. bool mUsePlaceholder;