Bug 1340483 - Part 3. Enable preview function only when input is marked as autofill field. r=heycam
MozReview-Commit-ID: FFqYJ3icRd7
This commit is contained in:
@@ -1099,6 +1099,7 @@ HTMLInputElement::HTMLInputElement(already_AddRefed<mozilla::dom::NodeInfo>& aNo
|
||||
, mNumberControlSpinnerSpinsUp(false)
|
||||
, mPickerRunning(false)
|
||||
, mSelectionCached(true)
|
||||
, mIsPreviewEnabled(false)
|
||||
{
|
||||
// We are in a type=text so we now we currenty need a nsTextEditorState.
|
||||
mInputData.mState =
|
||||
@@ -2930,6 +2931,24 @@ HTMLInputElement::GetPreviewValue(nsAString& aValue)
|
||||
}
|
||||
}
|
||||
|
||||
NS_IMETHODIMP_(void)
|
||||
HTMLInputElement::EnablePreview()
|
||||
{
|
||||
if (mIsPreviewEnabled) {
|
||||
return;
|
||||
}
|
||||
|
||||
mIsPreviewEnabled = true;
|
||||
// Reconstruct the frame to append an anonymous preview node
|
||||
nsLayoutUtils::PostRestyleEvent(this, nsRestyleHint(0), nsChangeHint_ReconstructFrame);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP_(bool)
|
||||
HTMLInputElement::IsPreviewEnabled()
|
||||
{
|
||||
return mIsPreviewEnabled;
|
||||
}
|
||||
|
||||
void
|
||||
HTMLInputElement::GetDisplayFileName(nsAString& aValue) const
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user