<?xml version="1.0"?> <!-- -*- Mode: HTML -*- --> 

<!-- The contents of this file are subject to the Netscape Public
License Version 1.1 (the "License"); you may not use this file
except in compliance with the License. You may obtain a copy of
the License at http://www.mozilla.org/NPL/

Software distributed under the License is distributed on an "AS
IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
implied. See the License for the specific language governing
rights and limitations under the License.

The Original Code is Mozilla Communicator client code, released
March 31, 1998.

The Initial Developer of the Original Code is Netscape
Communications Corporation. Portions created by Netscape are
Copyright (C) 1998-2000 Netscape Communications Corporation. All
Rights Reserved.

Contributor(s): ______________________________________. -->


<?xml-stylesheet href="chrome://global/skin/" type="text/css"?> 

<window id="main-window" xmlns:html="http://www.w3.org/1999/xhtml"
        xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
        onload="testElt(document.getElementById('below_left'));" orient="vertical">
  <script>
    <![CDATA[
    function generatePass() {
      dump("Trying to fail!\n");
      var v = document.createElement('label');
      v.setAttribute('style', 'color: green');
      v.setAttribute('value', "Passed the property test.");
      document.getElementById('main-window').appendChild(v);
    }

    function generateFail() {
      dump("Trying to pass!\n");
      var v = document.createElement('label');
      v.setAttribute('style', 'color: red');
      v.setAttribute('value', "Failed the property test.");
      document.getElementById('main-window').appendChild(v);
    }

    function testElt(popup) {
      if (popup.position == 'after_start')
          generatePass();
      else generateFail();
    }
  ]]>
  </script>
  <popupset>
    <popup id="above_left" position="before_start">
      <menuitem label="One"/>
      <menuitem label="Two"/>
      <menuitem label="Three"/>
    </popup>
    <popup id="above_right" position="before_end">
      <menuitem label="One"/>
      <menuitem label="Two"/>
      <menuitem label="Three"/>
    </popup>
    <popup id="below_left" position="after_start">
      <menuitem label="One"/>
      <menuitem label="Two"/>
      <menuitem label="Three"/>
    </popup>
    <popup id="below_right" position="after_end">
      <menuitem label="One"/>
      <menuitem label="Two"/>
      <menuitem label="Three"/>
    </popup>
    <popup id="left_top" position="start_before">
      <menuitem label="One"/>
      <menuitem label="Two"/>
      <menuitem label="Three"/>
    </popup>
    <popup id="left_bottom" position="start_after">
      <menuitem label="One"/>
      <menuitem label="Two"/>
      <menuitem label="Three"/>
    </popup>
    <popup id="right_top" position="end_before">
      <menuitem label="One"/>
      <menuitem label="Two"/>
      <menuitem label="Three"/>
    </popup>
    <popup id="right_bottom" position="end_after">
      <menuitem label="One"/>
      <menuitem label="Two"/>
      <menuitem label="Three"/>
    </popup>
    <popup id="overlap" position="overlap">
      <menuitem label="One"/>
      <menuitem label="Two"/>
      <menuitem label="Three"/>
    </popup>
    <popup id="at_pointer" position="at_pointer">
      <menuitem label="One"/>
      <menuitem label="Two"/>
      <menuitem label="Three"/>
    </popup>
    <popup id="after_pointer" position="after_pointer">
      <menuitem label="One"/>
      <menuitem label="Two"/>
      <menuitem label="Three"/>
    </popup>
  </popupset>

  <description>
    The 11 possible popup positions are enumerated below in the order that they are defined
    in the specification.
  </description>

  <hbox pack="left">
    <button label="Above Left" popup="above_left"/>
  </hbox>

  <hbox pack="left">
    <button label="Above Right" popup="above_right"/>
  </hbox>

  <hbox pack="left">
    <button label="Below Left" popup="below_left"/>
  </hbox>

  <hbox pack="left">
    <button label="Below Right" popup="below_right"/>
  </hbox>

  <hbox pack="left">
    <button label="Left Top" popup="left_top"/>
  </hbox>

  <hbox pack="left">
    <button label="Left Bottom" popup="left_bottom"/>
  </hbox>

  <hbox pack="left">
    <button label="Right Top" popup="right_top"/>
  </hbox>

  <hbox pack="left">
    <button label="Right Bottom" popup="right_bottom"/>
  </hbox>

  <hbox pack="left">
    <button label="Overlap" popup="overlap"/>
  </hbox>

  <hbox pack="left">
    <button label="At Pointer" popup="at_pointer"/>
  </hbox>

  <hbox pack="left">
    <button label="After Pointer" popup="after_pointer"/>
  </hbox>

</window>
