NS_IMPL_STRING_ATTR(nsHTMLSelectElement, Value, value)
nsHTMLSelectElement::GetValue(nsAString& aValue) { PRInt32 selectedIndex;  nsresult rv = GetSelectedIndex(&selectedIndex);  if (NS_SUCCEEDED(rv) && selectedIndex > -1) { nsCOMPtr<nsIDOMNode> node;  rv = Item(selectedIndex, getter_AddRefs(node));  if (NS_SUCCEEDED(rv) && node) { nsCOMPtr<nsIHTMLContent> option = do_QueryInterface(node);  if (option) { nsHTMLValue value;  rv = option->GetHTMLAttribute(nsHTMLAtoms::value, value);  if (NS_CONTENT_ATTR_HAS_VALUE == rv) { if (eHTMLUnit_String == value.GetUnit()) { value.GetStringValue(aValue); } else { aValue.SetLength(0); }  return NS_OK; } #if 0  rv = option->GetHTMLAttribute(nsHTMLAtoms::label, value);  if (NS_CONTENT_ATTR_HAS_VALUE == rv) { if (eHTMLUnit_String == value.GetUnit()) { value.GetStringValue(aValue); } else { aValue.SetLength(0); }  return NS_OK; } #endif nsCOMPtr<nsIDOMHTMLOptionElement> optElement(do_QueryInterface(node)); if (optElement) { optElement->GetText(aValue); }  return NS_OK; } } }  return rv; }
NS_IMPL_STRING_ATTR(nsHTMLSelectElement, Value, value)