index.html 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. <!doctype html>
  2. <title>CodeMirror: Web IDL mode</title>
  3. <meta charset="utf-8">
  4. <link rel="stylesheet" href="../../doc/docs.css">
  5. <link rel="stylesheet" href="../../lib/codemirror.css">
  6. <script src="../../lib/codemirror.js"></script>
  7. <script src="../../addon/edit/matchbrackets.js"></script>
  8. <script src="webidl.js"></script>
  9. <style type="text/css">.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>
  10. <div id="nav">
  11. <a href="http://codemirror.net"><h1>CodeMirror</h1><img id="logo" src="../../doc/logo.png"></a>
  12. <ul>
  13. <li><a href="../../index.html">Home</a>
  14. <li><a href="../../doc/manual.html">Manual</a>
  15. <li><a href="https://github.com/codemirror/codemirror">Code</a>
  16. </ul>
  17. <ul>
  18. <li><a href="../index.html">Language modes</a>
  19. <li><a class="active" href="#">Web IDL</a>
  20. </ul>
  21. </div>
  22. <article>
  23. <h2>Web IDL mode</h2>
  24. <div>
  25. <textarea id="code" name="code">
  26. [NamedConstructor=Image(optional unsigned long width, optional unsigned long height)]
  27. interface HTMLImageElement : HTMLElement {
  28. attribute DOMString alt;
  29. attribute DOMString src;
  30. attribute DOMString srcset;
  31. attribute DOMString sizes;
  32. attribute DOMString? crossOrigin;
  33. attribute DOMString useMap;
  34. attribute boolean isMap;
  35. attribute unsigned long width;
  36. attribute unsigned long height;
  37. readonly attribute unsigned long naturalWidth;
  38. readonly attribute unsigned long naturalHeight;
  39. readonly attribute boolean complete;
  40. readonly attribute DOMString currentSrc;
  41. // also has obsolete members
  42. };
  43. partial interface HTMLImageElement {
  44. attribute DOMString name;
  45. attribute DOMString lowsrc;
  46. attribute DOMString align;
  47. attribute unsigned long hspace;
  48. attribute unsigned long vspace;
  49. attribute DOMString longDesc;
  50. [TreatNullAs=EmptyString] attribute DOMString border;
  51. };
  52. </textarea>
  53. </div>
  54. <script>
  55. var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
  56. lineNumbers: true,
  57. matchBrackets: true
  58. });
  59. </script>
  60. <p><strong>MIME type defined:</strong> <code>text/x-webidl</code>.</p>
  61. </article>