Bug 1385788 - Move the ownership of preview value from PresState to HTMLSelectElement. r=bz

MozReview-Commit-ID: 9NC8h6SyWdh
This commit is contained in:
Ray Lin
2017-10-25 11:57:57 +08:00
parent b963414666
commit f0ce30b347
6 changed files with 19 additions and 53 deletions

View File

@@ -1931,23 +1931,15 @@ HTMLSelectElement::SetOpenInParentProcess(bool aVal)
}
}
void
HTMLSelectElement::GetPreviewValue(nsAString& aValue)
{
nsIFormControlFrame* formControlFrame = GetFormControlFrame(false);
nsIComboboxControlFrame* comboFrame = do_QueryFrame(formControlFrame);
if (comboFrame) {
comboFrame->GetPreviewText(aValue);
}
}
void
HTMLSelectElement::SetPreviewValue(const nsAString& aValue)
{
mPreviewValue = aValue;
nsContentUtils::RemoveNewlines(mPreviewValue);
nsIFormControlFrame* formControlFrame = GetFormControlFrame(false);
nsIComboboxControlFrame* comboFrame = do_QueryFrame(formControlFrame);
if (comboFrame) {
comboFrame->SetPreviewText(aValue);
comboFrame->RedisplaySelectedText();
}
}