Bug 1340488 - Add a chrome-only previewValue attribute to <select> for showing preview text. r=baku,heycam

MozReview-Commit-ID: En8e0hO35Lj
This commit is contained in:
Ray Lin
2017-05-03 17:08:44 +08:00
parent 280573c0d9
commit 349bf17fa6
6 changed files with 80 additions and 31 deletions

View File

@@ -1932,6 +1932,26 @@ 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)
{
nsIFormControlFrame* formControlFrame = GetFormControlFrame(false);
nsIComboboxControlFrame* comboFrame = do_QueryFrame(formControlFrame);
if (comboFrame) {
comboFrame->SetPreviewText(aValue);
}
}
JSObject*
HTMLSelectElement::WrapNode(JSContext* aCx, JS::Handle<JSObject*> aGivenProto)
{