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:
@@ -62,6 +62,7 @@ HTMLTextAreaElement::HTMLTextAreaElement(already_AddRefed<mozilla::dom::NodeInfo
|
||||
mDisabledChanged(false),
|
||||
mCanShowInvalidUI(true),
|
||||
mCanShowValidUI(true),
|
||||
mIsPreviewEnabled(false),
|
||||
mState(this)
|
||||
{
|
||||
AddMutationObserver(this);
|
||||
@@ -345,6 +346,24 @@ HTMLTextAreaElement::GetPreviewValue(nsAString& aValue)
|
||||
mState.GetPreviewText(aValue);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP_(void)
|
||||
HTMLTextAreaElement::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)
|
||||
HTMLTextAreaElement::IsPreviewEnabled()
|
||||
{
|
||||
return mIsPreviewEnabled;
|
||||
}
|
||||
|
||||
nsresult
|
||||
HTMLTextAreaElement::SetValueInternal(const nsAString& aValue,
|
||||
uint32_t aFlags)
|
||||
|
||||
Reference in New Issue
Block a user