DXR is a code search and navigation tool aimed at making sense of large projects. It supports full-text and regex searches as well as structural queries.

Mercurial (31ec81b5d7bb)

VCS Links

Line Code
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728
<!DOCTYPE HTML>
<html>
<!--
https://bugzilla.mozilla.org/show_bug.cgi?id=766694
-->
<head>
  <meta charset="utf-8">
  <title>Test for Bug 766694</title>
  <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
</head>
<body>
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=766694">Mozilla Bug 766694</a>
<p id="display"></p>
<div id="content" style="display: none">

</div>
<pre id="test">
<script type="application/javascript">

/** Test for Bug 766694 **/

// This is a list of all interfaces that are exposed to every webpage.
// Please only add things to this list with great care and proper review
// from the associated module peers.

// This file lists global interfaces we want exposed and verifies they
// are what we intend. Each entry in the arrays below can either be a
// simple string with the interface name, or an object with a 'name'
// property giving the interface name as a string, and additional
// properties which quality the exposure of that interface. For example:
//
// [
//   "AGlobalInterface",
//   {name: "ExperimentalThing", release: false},
//   {name: "OptionalThing", pref: "some.thing.enabled"},
//   {name: "FancyControl", xbl: true},
// ];
//
// See createInterfaceMap() below for a complete list of properties.

// IMPORTANT: Do not change this list without review from
//            a JavaScript Engine peer!
var ecmaGlobals =
  [
    "Array",
    "ArrayBuffer",
    "Boolean",
    "DataView",
    "Date",
    "Error",
    "EvalError",
    "Float32Array",
    "Float64Array",
    "Function",
    // NB: We haven't bothered to resolve constants like Infinity and NaN on
    // Xrayed windows (which are seen from the XBL scope). We could support
    // this if needed with some refactoring.
    {name: "Infinity", xbl: false},
    "Int16Array",
    "Int32Array",
    "Int8Array",
    "InternalError",
    {name: "Intl", desktop: true, release: false},
    "Iterator",
    "JSON",
    "Map",
    "Math",
    {name: "NaN", xbl: false},
    "Number",
    "Object",
    {name: "ParallelArray", nightly: true},
    "Proxy",
    "RangeError",
    "ReferenceError",
    "RegExp",
    "Set",
    "StopIteration",
    "String",
    "SyntaxError",
    {name: "TypedObject", nightly: true},
    "TypeError",
    "Uint16Array",
    "Uint32Array",
    "Uint8Array",
    "Uint8ClampedArray",
    "URIError",
    "WeakMap",
  ];
// IMPORTANT: Do not change the list above without review from
//            a JavaScript Engine peer!

// IMPORTANT: Do not change the list below without review from a DOM peer,
//            except to remove items from it!
//
// This is a list of interfaces that were prefixed with 'moz' instead of 'Moz'.
// We should never to that again, interfaces in the DOM start with an uppercase
// letter. If you think you need to add an interface here, DON'T. Rename your
// interface.
var legacyMozPrefixedInterfaces =
  [
    "mozContact",
    "mozRTCIceCandidate",
    "mozRTCPeerConnection",
    "mozRTCSessionDescription",
  ];
// IMPORTANT: Do not change the list above without review from a DOM peer,
//            except to remove items from it!

// IMPORTANT: Do not change the list below without review from a DOM peer!
var interfaceNamesInGlobalScope =
  [
    "AnalyserNode",
    "AnimationEvent",
    "ArchiveRequest",
    "Attr",
    "Audio",
    "AudioBuffer",
    {name: "AudioChannelManager", b2g: true},
    "AudioContext",
    "AudioBufferSourceNode",
    "AudioDestinationNode",
    "AudioListener",
    "AudioNode",
    "AudioParam",
    "AudioProcessingEvent",
    "AudioStreamTrack",
    "BarProp",
    "BatteryManager",
    "BeforeUnloadEvent",
    "BiquadFilterNode",
    "Blob",
    "BlobEvent",
    {name: "BluetoothAdapter", b2g: true},
    {name: "BluetoothDevice", b2g: true},
    {name: "BluetoothDeviceEvent", b2g: true},
    {name: "BluetoothDiscoveryStateChangedEvent", b2g: true},
    {name: "BluetoothManager", b2g: true},
    {name: "BluetoothStatusChangedEvent", b2g: true},
    {name: "BoxObject", xbl: true},
    {name: "BrowserFeedWriter", desktop: true},
    {name: "CallEvent", b2g: true, pref: "dom.telephony.enabled"},
    {name: "CallGroupErrorEvent", b2g: true, pref: "dom.telephony.enabled"},
    "CameraCapabilities",
    "CameraControl",
    "CameraManager",
    "CanvasGradient",
    "CanvasPattern",
    "CanvasRenderingContext2D",
    "CaretPosition",
    "CDATASection",
    {name: "CFStateChangeEvent", b2g: true, pref: "dom.mobileconnection.enabled"},
    "ChannelMergerNode",
    "ChannelSplitterNode",
    "CharacterData",
    {name: "ChromeWindow", xbl: true},
    "ClipboardEvent",
    "CloseEvent",
    "CommandEvent",
    "Comment",
    "CompositionEvent",
    "Controllers",
    "ConvolverNode",
    {name: "CRMFObject", desktop: true},
    "Crypto",
    "CSS",
    "CSS2Properties",
    "CSSCharsetRule",
    "CSSConditionRule",
    "CSSFontFaceRule",
    {name: "CSSFontFeatureValuesRule", release: false},
    "CSSGroupingRule",
    "CSSImportRule",
    "CSSMediaRule",
    "CSSMozDocumentRule",
    "CSSNameSpaceRule",
    "CSSPageRule",
    "CSSPrimitiveValue",
    "CSSRule",
    "CSSRuleList",
    "CSSStyleDeclaration",
    "CSSStyleRule",
    "CSSStyleSheet",
    "CSSSupportsRule",
    "CSSValue",
    "CSSValueList",
    "CustomEvent",
    "DataChannel",
    "DataContainerEvent",
    {name: "DataErrorEvent", b2g: true, pref: "dom.mobileconnection.enabled"},
    {name: "DataStore", b2g: true},
    {name: "DataStoreChangeEvent", b2g: true},
    {name: "DataStoreCursor", b2g: true},
    "DataTransfer",
    "DelayNode",
    "DesktopNotification",
    "DesktopNotificationCenter",
    "DeviceAcceleration",
    "DeviceLightEvent",
    "DeviceMotionEvent",
    "DeviceOrientationEvent",
    "DeviceProximityEvent",
    "DeviceRotationRate",
    "DeviceStorage",
    "DeviceStorageChangeEvent",
    "Document",
    "DocumentFragment",
    "DocumentType",
    {name: "DOMConstructor", xbl: true},
    "DOMCursor",
    "DOMError",
    "DOMException",
    "DOMImplementation",
    "DOMMMIError",
    "DOMParser",
    "DOMRect",
    "DOMRectList",
    "DOMRequest",
    "DOMSettableTokenList",
    "DOMStringList",
    "DOMStringMap",
    "DOMTokenList",
    "DOMTransactionEvent",
    "DragEvent",
    "DynamicsCompressorNode",
    "Element",
    "ElementReplaceEvent",
    "ErrorEvent",
    "Event",
    "EventListenerInfo",
    "EventSource",
    "EventTarget",
    "File",
    "FileHandle",
    "FileList",
    "FileReader",
    "FileRequest",
    {name: "FMRadio", b2g: true},
    "FocusEvent",
    "FormData",
    "GainNode",
    {name: "Gamepad", desktop: true},
    {name: "GamepadAxisMoveEvent", desktop: true},
    {name: "GamepadButtonEvent", desktop: true},
    {name: "GamepadButton", desktop: true},
    {name: "GamepadEvent", desktop: true},
    "HashChangeEvent",
    "History",
    "HTMLAnchorElement",
    "HTMLAppletElement",
    "HTMLAreaElement",
    "HTMLAudioElement",
    "HTMLBaseElement",
    "HTMLBodyElement",
    "HTMLBRElement",
    "HTMLButtonElement",
    "HTMLCanvasElement",
    "HTMLCollection",
    "HTMLContentElement",
    "HTMLDataElement",
    "HTMLDataListElement",
    "HTMLDirectoryElement",
    "HTMLDivElement",
    "HTMLDListElement",
    "HTMLDocument",
    "HTMLElement",
    "HTMLEmbedElement",
    "HTMLFieldSetElement",
    "HTMLFontElement",
    "HTMLFormControlsCollection",
    "HTMLFormElement",
    "HTMLFrameElement",
    "HTMLFrameSetElement",
    "HTMLHeadElement",
    "HTMLHeadingElement",
    "HTMLHRElement",
    "HTMLHtmlElement",
    "HTMLIFrameElement",
    "HTMLImageElement",
    "HTMLInputElement",
    "HTMLLabelElement",
    "HTMLLegendElement",
    "HTMLLIElement",
    "HTMLLinkElement",
    "HTMLMapElement",
    "HTMLMediaElement",
    "HTMLMenuElement",
    "HTMLMenuItemElement",
    "HTMLMetaElement",
    "HTMLMeterElement",
    "HTMLModElement",
    "HTMLObjectElement",
    "HTMLOListElement",
    "HTMLOptGroupElement",
    "HTMLOptionElement",
    "HTMLOptionsCollection",
    "HTMLOutputElement",
    "HTMLParagraphElement",
    "HTMLParamElement",
    "HTMLPreElement",
    "HTMLProgressElement",
    "HTMLPropertiesCollection",
    "HTMLQuoteElement",
    "HTMLScriptElement",
    "HTMLSelectElement",
    "HTMLSourceElement",
    "HTMLSpanElement",
    "HTMLStyleElement",
    "HTMLTableCaptionElement",
    "HTMLTableCellElement",
    "HTMLTableColElement",
    "HTMLTableElement",
    "HTMLTableRowElement",
    "HTMLTableSectionElement",
    "HTMLTemplateElement",
    "HTMLTextAreaElement",
    "HTMLTimeElement",
    "HTMLTitleElement",
    "HTMLUListElement",
    "HTMLUnknownElement",
    "HTMLVideoElement",
    {name: "IccChangeEvent", b2g: true, pref: "dom.icc.enabled"},
    {name: "IccCardLockError", b2g: true, pref: "dom.icc.enabled"},
    "IDBCursor",
    "IDBCursorWithValue",
    "IDBDatabase",
    "IDBFactory",
    "IDBFileHandle",
    "IDBIndex",
    "IDBKeyRange",
    "IDBObjectStore",
    "IDBOpenDBRequest",
    "IDBRequest",
    "IDBTransaction",
    "IDBVersionChangeEvent",
    "Image",
    "ImageData",
    {name: "InstallTrigger", b2g: false, xbl: false},
    "KeyEvent",
    "KeyboardEvent",
    "LoadStatus",
    "LocalMediaStream",
    "Location",
    "LockedFile",
    "MediaElementAudioSourceNode",
    "MediaError",
    "MediaList",
    "MediaQueryList",
    "MediaRecorder",
    "MediaStream",
    "MediaStreamAudioDestinationNode",
    "MediaStreamAudioSourceNode",
    {name: "MediaStreamEvent", pref: "media.peerconnection.enabled"},
    "MediaStreamTrack",
    "MessageEvent",
    "MessagePort",
    "MimeType",
    "MimeTypeArray",
    "ModalContentWindow",
    "MouseEvent",
    "MouseScrollEvent",
    {name: "MozActivity", b2g: true},
    "MozApplicationEvent",
    {name: "MozCellBroadcast", b2g: true, pref: "dom.cellbroadcast.enabled"},
    {name: "MozCellBroadcastEvent", b2g: true, pref: "dom.cellbroadcast.enabled"},
    "MozConnection",
    "mozContact",
    "MozContactChangeEvent",
    "MozCSSKeyframeRule",
    "MozCSSKeyframesRule",
    {name: "MozEmergencyCbModeEvent", b2g: true, pref: "dom.mobileconnection.enabled"},
    {name: "MozIcc", b2g: true, pref: "dom.icc.enabled"},
    {name: "MozIccManager", b2g: true, pref: "dom.icc.enabled"},
    {name: "MozInputContext", b2g: true},
    {name: "MozInputMethodManager", b2g: true},
    "MozMmsEvent",
    "MozMmsMessage",
    {name: "MozMobileConnection", b2g: true, pref: "dom.mobileconnection.enabled"},
    {name: "MozMobileConnectionArray", b2g: true, pref: "dom.mobileconnection.enabled"},
    "MozMobileMessageManager",
    "MozMobileMessageThread",
    "MozNamedAttrMap",
    {name: "MozNdefRecord", b2g: true},
    {name: "MozNFCPeer", b2g: true},
    {name: "MozNFCTag", b2g: true},
    {name: "MozOtaStatusEvent", b2g: true, pref: "dom.mobileconnection.enabled"},
    "MozPowerManager",
    {name: "mozRTCIceCandidate", pref: "media.peerconnection.enabled"},
    {name: "mozRTCPeerConnection", pref: "media.peerconnection.enabled"},
    {name: "mozRTCSessionDescription", pref: "media.peerconnection.enabled"},
    "MozSettingsEvent",
    "MozSmsEvent",
    "MozSmsFilter",
    "MozSmsMessage",
    "MozSmsSegmentInfo",
    {name: "MozSpeakerManager", b2g: true},
    {name: "MozStkCommandEvent", b2g: true, pref: "dom.icc.enabled"},
    {name: "MozTimeManager", b2g: true},
    {name: "MozVoicemail", b2g: true, pref: "dom.voicemail.enabled"},
    {name: "MozVoicemailEvent", b2g: true, pref: "dom.voicemail.enabled"},
    "MozWakeLock",
    {name: "MozWifiConnectionInfoEvent", b2g: true},
    {name: "MozWifiStatusChangeEvent", b2g: true},
    "MutationEvent",
    "MutationObserver",
    "MutationRecord",
    "Navigator",
    "Node",
    "NodeFilter",
    "NodeIterator",
    "NodeList",
    "NotifyAudioAvailableEvent",
    "Notification",
    "NotifyPaintEvent",
    "OfflineAudioCompletionEvent",
    "OfflineAudioContext",
    "OfflineResourceList",
    "Option",
    "OscillatorNode",
    "PageTransitionEvent",
    "PaintRequest",
    "PaintRequestList",
    "PannerNode",
    "Performance",
    "PerformanceNavigation",
    "PerformanceTiming",
    "PeriodicWave",
    "PhoneNumberService",
    "Plugin",
    "PluginArray",
    {name: "PointerEvent", pref: "dom.w3c_pointer_events.enabled"},
    "PopStateEvent",
    "PopupBlockedEvent",
    "ProcessingInstruction",
    "ProgressEvent",
    {name: "Promise", b2g: false, release: false},
    "PropertyNodeList",
    "Range",
    "RecordErrorEvent",
    "Rect",
    "RGBColor",
    {name: "RTCDataChannelEvent", pref: "media.peerconnection.enabled"},
    {name: "RTCPeerConnectionIceEvent", pref: "media.peerconnection.enabled"},
    {name: "RTCStatsReport", pref: "media.peerconnection.enabled"},
    "Screen",
    "ScriptProcessorNode",
    "ScrollAreaEvent",
    "Selection",
    "SettingsLock",
    "SettingsManager",
    {name: "ShadowRoot", pref: "dom.webcomponents.enabled"},
    "SimpleGestureEvent",
    {name: "SimpleTest", xbl: false},
    "SmartCardEvent",
    "SpeechRecognitionError",
    "SpeechRecognitionEvent",
    "SpeechSynthesisEvent",
    {name: "SpeechSynthesis", b2g: true},
    {name: "SpeechSynthesisUtterance", b2g: true},
    {name: "SpeechSynthesisVoice", b2g: true},
    {name: "SpecialPowers", xbl: false},
    "Storage",
    "StorageEvent",
    "StyleSheet",
    "StyleSheetList",
    "SVGAElement",
    "SVGAltGlyphElement",
    "SVGAngle",
    "SVGAnimatedAngle",
    "SVGAnimatedBoolean",
    "SVGAnimatedEnumeration",
    "SVGAnimatedInteger",
    "SVGAnimatedLength",
    "SVGAnimatedLengthList",
    "SVGAnimatedNumber",
    "SVGAnimatedNumberList",
    "SVGAnimatedPreserveAspectRatio",
    "SVGAnimatedRect",
    "SVGAnimatedString",
    "SVGAnimatedTransformList",
    "SVGAnimateElement",
    "SVGAnimateMotionElement",
    "SVGAnimateTransformElement",
    "SVGAnimationElement",
    "SVGCircleElement",
    "SVGClipPathElement",
    "SVGComponentTransferFunctionElement",
    "SVGDefsElement",
    "SVGDescElement",
    "SVGDocument",
    "SVGElement",
    "SVGEllipseElement",
    "SVGFEBlendElement",
    "SVGFEColorMatrixElement",
    "SVGFEComponentTransferElement",
    "SVGFECompositeElement",
    "SVGFEConvolveMatrixElement",
    "SVGFEDiffuseLightingElement",
    "SVGFEDisplacementMapElement",
    "SVGFEDistantLightElement",
    "SVGFEFloodElement",
    "SVGFEFuncAElement",
    "SVGFEFuncBElement",
    "SVGFEFuncGElement",
    "SVGFEFuncRElement",
    "SVGFEGaussianBlurElement",
    "SVGFEImageElement",
    "SVGFEMergeElement",
    "SVGFEMergeNodeElement",
    "SVGFEMorphologyElement",
    "SVGFEOffsetElement",
    "SVGFEPointLightElement",
    "SVGFESpecularLightingElement",
    "SVGFESpotLightElement",
    "SVGFETileElement",
    "SVGFETurbulenceElement",
    "SVGFilterElement",
    "SVGForeignObjectElement",
    "SVGGElement",
    "SVGGradientElement",
    "SVGGraphicsElement",
    "SVGImageElement",
    "SVGLength",
    "SVGLengthList",
    "SVGLinearGradientElement",
    "SVGLineElement",
    "SVGMarkerElement",
    "SVGMaskElement",
    "SVGMatrix",
    "SVGMetadataElement",
    "SVGMPathElement",
    "SVGNumber",
    "SVGNumberList",
    "SVGPathElement",
    "SVGPathSeg",
    "SVGPathSegArcAbs",
    "SVGPathSegArcRel",
    "SVGPathSegClosePath",
    "SVGPathSegCurvetoCubicAbs",
    "SVGPathSegCurvetoCubicRel",
    "SVGPathSegCurvetoCubicSmoothAbs",
    "SVGPathSegCurvetoCubicSmoothRel",
    "SVGPathSegCurvetoQuadraticAbs",
    "SVGPathSegCurvetoQuadraticRel",
    "SVGPathSegCurvetoQuadraticSmoothAbs",
    "SVGPathSegCurvetoQuadraticSmoothRel",
    "SVGPathSegLinetoAbs",
    "SVGPathSegLinetoHorizontalAbs",
    "SVGPathSegLinetoHorizontalRel",
    "SVGPathSegLinetoRel",
    "SVGPathSegLinetoVerticalAbs",
    "SVGPathSegLinetoVerticalRel",
    "SVGPathSegList",
    "SVGPathSegMovetoAbs",
    "SVGPathSegMovetoRel",
    "SVGPatternElement",
    "SVGPoint",
    "SVGPointList",
    "SVGPolygonElement",
    "SVGPolylineElement",
    "SVGPreserveAspectRatio",
    "SVGRadialGradientElement",
    "SVGRect",
    "SVGRectElement",
    "SVGScriptElement",
    "SVGSetElement",
    "SVGStopElement",
    "SVGStringList",
    "SVGStyleElement",
    "SVGSVGElement",
    "SVGSwitchElement",
    "SVGSymbolElement",
    "SVGTextContentElement",
    "SVGTextElement",
    "SVGTextPathElement",
    "SVGTextPositioningElement",
    "SVGTitleElement",
    "SVGTransform",
    "SVGTransformList",
    "SVGTSpanElement",
    "SVGUnitTypes",
    "SVGUseElement",
    "SVGViewElement",
    "SVGZoomAndPan",
    "SVGZoomEvent",
    {name: "Telephony", b2g: true, pref: "dom.telephony.enabled"},
    {name: "TelephonyCall", b2g: true, pref: "dom.telephony.enabled"},
    {name: "TelephonyCallGroup", b2g: true, pref: "dom.telephony.enabled"},
    "Text",
    "TextDecoder",
    "TextEncoder",
    "TextMetrics",
    "TimeEvent",
    "TimeRanges",
    "Touch",
    "TouchEvent",
    "TouchList",
    "TrackEvent",
    "TransitionEvent",
    {name: "TreeColumn", xbl: true},
    {name: "TreeColumns", xbl: true},
    {name: "TreeContentView", xbl: true},
    {name: "TreeSelection", xbl: true},
    "TreeWalker",
    "UIEvent",
    "UndoManager",
    "URL",
    {name: "UserDataHandler", xbl: true},
    "UserProximityEvent",
    {name: "USSDReceivedEvent", b2g: true, pref: "dom.mobileconnection.enabled"},
    "ValidityState",
    "VideoStreamTrack",
    "WaveShaperNode",
    "WebGLActiveInfo",
    "WebGLBuffer",
    "WebGLFramebuffer",
    "WebGLProgram",
    "WebGLRenderbuffer",
    "WebGLRenderingContext",
    "WebGLShader",
    "WebGLShaderPrecisionFormat",
    "WebGLTexture",
    "WebGLUniformLocation",
    "WebGLVertexArray",
    "WebSocket",
    "WheelEvent",
    "Window",
    "WindowUtils",
    "Worker",
    "XMLDocument",
    "XMLHttpRequest",
    "XMLHttpRequestUpload",
    "XMLSerializer",
    "XMLStylesheetProcessingInstruction",
    "XPathEvaluator",
    "XPathExpression",
    "XPathNamespace",
    "XPathNSResolver",
    "XPathResult",
    "XSLTProcessor",
    {name: "XULButtonElement", xbl: true},
    {name: "XULCheckboxElement", xbl: true},
    {name: "XULCommandDispatcher", xbl: true},
    {name: "XULCommandEvent", xbl: true},
    {name: "XULControlElement", xbl: true},
    {name: "XULControllers", xbl: true},
    {name: "XULDocument", xbl: true},
    {name: "XULElement", xbl: true},
    {name: "XULLabeledControlElement", xbl: true},
    {name: "XULPopupElement", xbl: true},
    {name: "XULTemplateBuilder", xbl: true},
    {name: "XULTreeBuilder", xbl: true},
  ];
// IMPORTANT: Do not change the list above without review from a DOM peer!

function createInterfaceMap(isXBLScope) {
  var prefs = SpecialPowers.Services.prefs;
  var version = SpecialPowers.Cc["@mozilla.org/xre/app-info;1"].getService(SpecialPowers.Ci.nsIXULAppInfo).version;
  var isNightly = version.endsWith("a1");
  var isRelease = !version.contains("a");
  var isDesktop = !/Mobile|Tablet/.test(navigator.userAgent);
  var isB2G = !isDesktop && !navigator.userAgent.contains("Android");

  var interfaceMap = {};

  function addInterfaces(interfaces, shouldExpect)
  {
    for (var entry of interfaces) {
      if (typeof(entry) === "string") {
        interfaceMap[entry] = shouldExpect;
      } else if ((entry.nightly === !isNightly) ||
                 (entry.xbl === !isXBLScope) ||
                 (entry.desktop === !isDesktop) ||
                 (entry.b2g === !isB2G) ||
                 (entry.release === !isRelease) ||
                 (entry.pref && !prefs.getBoolPref(entry.pref))) {
        interfaceMap[entry.name] = false;
      } else {
        interfaceMap[entry.name] = shouldExpect;
      }
    }
  }

  addInterfaces(ecmaGlobals, true);
  addInterfaces(interfaceNamesInGlobalScope, true);

  return interfaceMap;
}

function runTest(isXBLScope) {
  var interfaceMap = createInterfaceMap(isXBLScope);
  for (var name of Object.getOwnPropertyNames(window)) {
    // An interface name should start with an upper case character.
    // However, we have a couple of legacy interfaces that start with 'moz', so
    // we want to allow those until we can remove them.
    if (!/^[A-Z]/.test(name) && legacyMozPrefixedInterfaces.indexOf(name) < 0) {
      continue;
    }
    ok(interfaceMap[name],
       "If this is failing: DANGER, are you sure you want to expose the new interface " + name +
       " to all webpages as a property on the window? Do not make a change to this file without a " +
       " review from a DOM peer for that specific change!!! (or a JS peer for changes to ecmaGlobals)");
    delete interfaceMap[name];
  }
  for (var name of Object.keys(interfaceMap)) {
    ok(name in window === interfaceMap[name],
       name + " should " + (interfaceMap[name] ? "" : " NOT") + " be defined on the " + (isXBLScope ? "XBL" : "global") +" scope");
    if (!interfaceMap[name]) {
      delete interfaceMap[name];
    }
  }
  if (isXBLScope) {
    todo_is(Object.keys(interfaceMap).length, 0,
            "The following interface(s) are not enumerated: " + Object.keys(interfaceMap).join(", "));
  } else {
    is(Object.keys(interfaceMap).length, 0,
       "The following interface(s) are not enumerated: " + Object.keys(interfaceMap).join(", "));
  }
}

runTest(false);
SimpleTest.waitForExplicitFinish();

</script>
<span id="span" style="-moz-binding: url(file_interfaces.xml)"></span>
</pre>
</body>
</html>