<?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('testelt'));" 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(label) {
      if (label.disabled == false &&
          label.control == 'textbox' &&
          label.accesskey == 'c' &&
          label.value == 'Click this label to focus the text box to the right. ' &&
          label.crop == '')
          generatePass();
      else generateFail();
    }
  ]]>
  </script>
  <label value="This is a single-line label.  It will not wrap no matter how long it becomes."/>
  <label disabled="true" value="This label should appear disabled."/>
  <hbox align="center">
    <label id="testelt" control="textbox" accesskey="c" value="Click this label to focus the text box to the right. "/>
    <textbox id="textbox" flex="1"/>
  </hbox>
  <hbox>
    <label width="100" style="margin: 4px; border: 1px solid green">
      This label has a green border.  The text in this label should wrap to multiple lines.
      You should be able to read all of the text on this label.
    </label>
    <spring flex="1"/>
  </hbox>
  <hbox>
    <label crop="right" width="300" value="This label should be cropped right, because the text is too long to fit given the specified width."/>
    <spring flex="1"/>
  </hbox>
  <hbox>
    <label crop="left" width="300" value="This label should be cropped left, because the text is too long to fit given the specified width.  Left cropping should occur."/>
    <spring flex="1"/>
  </hbox>
  <hbox>
    <label crop="center" width="300" value="This one is cropped center, because the text is too long to fit given the specified width."/>
    <spring flex="1"/>
  </hbox>
</window>
