nsIDOMHTMLSelectElement.idl 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. /* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
  2. /* This Source Code Form is subject to the terms of the Mozilla Public
  3. * License, v. 2.0. If a copy of the MPL was not distributed with this
  4. * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
  5. #include "nsIDOMHTMLElement.idl"
  6. #include "nsIDOMHTMLOptionsCollection.idl"
  7. /**
  8. * The nsIDOMHTMLSelectElement interface is the interface to a [X]HTML
  9. * select element.
  10. *
  11. * This interface is trying to follow the DOM Level 2 HTML specification:
  12. * http://www.w3.org/TR/DOM-Level-2-HTML/
  13. *
  14. * with changes from the work-in-progress WHATWG HTML specification:
  15. * http://www.whatwg.org/specs/web-apps/current-work/
  16. */
  17. interface nsIDOMValidityState;
  18. [uuid(d8914a2d-3556-4b66-911c-a84c4394e7fa)]
  19. interface nsIDOMHTMLSelectElement : nsISupports
  20. {
  21. attribute boolean autofocus;
  22. attribute boolean disabled;
  23. readonly attribute nsIDOMHTMLFormElement form;
  24. attribute boolean multiple;
  25. attribute DOMString name;
  26. attribute unsigned long size;
  27. readonly attribute DOMString type;
  28. readonly attribute nsIDOMHTMLOptionsCollection options;
  29. attribute unsigned long length;
  30. nsIDOMNode item(in unsigned long index);
  31. nsIDOMNode namedItem(in DOMString name);
  32. // This add method implementation means the following
  33. // since IDL doesn't support overfload.
  34. // void add(in nsIDOMHTMLElement, [optional] in nsIDOMHTMLElement)
  35. // void add(in nsIDOMHTMLElement, in long)
  36. void add(in nsIDOMHTMLElement element,
  37. [optional] in nsIVariant before)
  38. raises(DOMException);
  39. void remove(in long index);
  40. readonly attribute nsIDOMHTMLCollection selectedOptions;
  41. attribute long selectedIndex;
  42. attribute DOMString value;
  43. // The following lines are part of the constraint validation API, see:
  44. // http://www.whatwg.org/specs/web-apps/current-work/#the-constraint-validation-api
  45. readonly attribute boolean willValidate;
  46. readonly attribute nsIDOMValidityState validity;
  47. readonly attribute DOMString validationMessage;
  48. boolean checkValidity();
  49. void setCustomValidity(in DOMString error);
  50. attribute boolean required;
  51. };