Revision: 6802
Author: [email protected]
Date: Tue Nov 10 10:32:15 2009
Log: Merging tr...@6798, 6799, 6800 into this branch

http://code.google.com/p/google-web-toolkit/source/detail?r=6802

Added:
   
/releases/2.0/samples/mail/src/com/google/gwt/sample/mail/client/Tasks.ui.xml
  /releases/2.0/samples/mail/src/com/google/gwt/sample/mail/client/global.css
  /releases/2.0/user/src/com/google/gwt/layout/client/LayoutImplIE8.java
Deleted:
  /releases/2.0/samples/mail/war/Mail.css
Modified:
  /releases/2.0/branch-info.txt
  /releases/2.0/samples/mail/src/com/google/gwt/sample/mail/Mail.gwt.xml
   
/releases/2.0/samples/mail/src/com/google/gwt/sample/mail/client/Contacts.java
   
/releases/2.0/samples/mail/src/com/google/gwt/sample/mail/client/Contacts.ui.xml
  /releases/2.0/samples/mail/src/com/google/gwt/sample/mail/client/Mail.java
   
/releases/2.0/samples/mail/src/com/google/gwt/sample/mail/client/MailList.ui.xml
  /releases/2.0/samples/mail/src/com/google/gwt/sample/mail/client/Tasks.java
  /releases/2.0/samples/mail/war/Mail.html
  /releases/2.0/user/src/com/google/gwt/layout/Layout.gwt.xml
  /releases/2.0/user/src/com/google/gwt/layout/client/LayoutImpl.java
  /releases/2.0/user/src/com/google/gwt/layout/client/LayoutImplIE6.java
   
/releases/2.0/user/src/com/google/gwt/resources/css/CssGenerationVisitor.java
  /releases/2.0/user/test/com/google/gwt/layout/client/LayoutTest.java

=======================================
--- /dev/null
+++  
/releases/2.0/samples/mail/src/com/google/gwt/sample/mail/client/Tasks.ui.xml   
 
Tue Nov 10 10:32:15 2009
@@ -0,0 +1,24 @@
+<ui:UiBinder
+  xmlns:ui='urn:ui:com.google.gwt.uibinder'
+  xmlns:g='urn:import:com.google.gwt.user.client.ui'
+  xmlns:mail='urn:import:com.google.gwt.sample.mail.client'>
+
+  <ui:style>
+  .tasks {
+    padding: 0.5em;
+  }
+
+  .item {
+    display: block;
+  }
+  </ui:style>
+
+  <g:FlowPanel styleName='{style.tasks}'>
+    <g:CheckBox styleName='{style.item}'>Get groceries</g:CheckBox>
+    <g:CheckBox styleName='{style.item}'>Walk the dog</g:CheckBox>
+    <g:CheckBox styleName='{style.item}'>Start Web 2.0 company</g:CheckBox>
+    <g:CheckBox styleName='{style.item}'>Write cool app in GWT</g:CheckBox>
+    <g:CheckBox styleName='{style.item}'>Get funding</g:CheckBox>
+    <g:CheckBox styleName='{style.item}'>Take a vacation</g:CheckBox>
+  </g:FlowPanel>
+</ui:UiBinder>
=======================================
--- /dev/null
+++  
/releases/2.0/samples/mail/src/com/google/gwt/sample/mail/client/global.css     
 
Tue Nov 10 10:32:15 2009
@@ -0,0 +1,54 @@
+body, table {
+  font-size: small;
+}
+body {
+  font-family: Helvetica, Arial, sans-serif;
+  color: #000;
+  background: #fff;
+}
+a:link, a:visited, a:hover, a:active {
+  color: #000;
+  text-decoration: none;
+}
+
+/* Dialog boxes */
+.dialogTopLeftInner, .dialogMiddleLeftInner, .dialogBottomLeftInner,
+.dialogTopRightInner, .dialogMiddleRightInner, .dialogBottomRightInner {
+  display: none;
+}
+.gwt-DialogBox {
+  background-color: white;
+  border: 1px solid #666;
+}
+.gwt-DialogBox .Caption {
+  background: #d3d6dd url(gradient_bg_th.png) repeat-x bottom left;
+  font-weight: bold;
+  text-shadow: #fff 0 2px 2px;
+  cursor: default;
+  padding: 5px 10px;
+  border-bottom: 1px solid #999;
+  text-align: left;
+}
+.gwt-DialogBox .dialogContent {
+}
+.gwt-DialogBox .gwt-Button {
+  margin: 10px;
+}
+.gwt-PopupGlass {
+  background-color: #000;
+  opacity: 0.3;
+  filter: literal("alpha(opacity=30)");
+}
+
+/* GWT Tree */
+.gwt-Tree {
+}
+.gwt-Tree .gwt-TreeItem {
+  padding: 0;
+  cursor: hand;
+  cursor: pointer;
+  display: block !important;
+}
+.gwt-Tree .gwt-TreeItem-selected {
+  background: #ccc;
+}
=======================================
--- /dev/null
+++ /releases/2.0/user/src/com/google/gwt/layout/client/LayoutImplIE8.java      
 
Tue Nov 10 10:32:15 2009
@@ -0,0 +1,121 @@
+/*
+ * Copyright 2009 Google Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (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.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,  
WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations  
under
+ * the License.
+ */
+package com.google.gwt.layout.client;
+
+import com.google.gwt.dom.client.Style;
+import com.google.gwt.dom.client.Style.Unit;
+import com.google.gwt.layout.client.Layout.Layer;
+
+/**
+ * This implementation is used on IE7 and IE8. Unlike {...@link LayoutImpl},  
it
+ * converts all values to pixels before setting them. This is necessary  
because
+ * these browsers incorrectly calculate the relative sizes and positions  
of CSS
+ * properties specified in certain units (e.g., when the value of an 'em'  
is
+ * non-integral in pixels).
+ */
+public class LayoutImplIE8 extends LayoutImpl {
+
+  public void layout(Layer layer) {
+    Style style = layer.container.getStyle();
+
+    if (layer.setLeft) {
+      setValue(layer, "left", layer.left, layer.leftUnit, false, false);
+    } else {
+      style.clearLeft();
+    }
+    if (layer.setRight) {
+      setValue(layer, "right", layer.right, layer.rightUnit, false, false);
+    } else {
+      style.clearRight();
+    }
+    if (layer.setTop) {
+      setValue(layer, "top", layer.top, layer.topUnit, true, false);
+    } else {
+      style.clearTop();
+    }
+    if (layer.setBottom) {
+      setValue(layer, "bottom", layer.bottom, layer.bottomUnit, true,  
false);
+    } else {
+      style.clearBottom();
+    }
+    if (layer.setWidth) {
+      setValue(layer, "width", layer.width, layer.widthUnit, false, true);
+    } else {
+      style.clearWidth();
+    }
+    if (layer.setHeight) {
+      setValue(layer, "height", layer.height, layer.heightUnit, true,  
true);
+    } else {
+      style.clearHeight();
+    }
+
+    style = layer.child.getStyle();
+    switch (layer.hPos) {
+      case BEGIN:
+        style.setLeft(0, Unit.PX);
+        style.clearRight();
+        break;
+      case END:
+        style.clearLeft();
+        style.setRight(0, Unit.PX);
+        break;
+      case STRETCH:
+        style.setLeft(0, Unit.PX);
+        style.setRight(0, Unit.PX);
+        break;
+    }
+
+    switch (layer.vPos) {
+      case BEGIN:
+        style.setTop(0, Unit.PX);
+        style.clearBottom();
+        break;
+      case END:
+        style.clearTop();
+        style.setBottom(0, Unit.PX);
+        break;
+      case STRETCH:
+        style.setTop(0, Unit.PX);
+        style.setBottom(0, Unit.PX);
+        break;
+    }
+  }
+
+  private void setValue(Layer layer, String prop, double value, Unit unit,
+      boolean vertical, boolean noNegative) {
+    switch (unit) {
+      case PX:
+      case PCT:
+        // Leave PX and PCT alone. PX doesn't need to be translated, and  
PCT
+        // can't be.
+        break;
+
+      default:
+        value = value
+            * (int) getUnitSizeInPixels(layer.container, unit, vertical);
+        unit = Unit.PX;
+        break;
+    }
+
+    if (noNegative) {
+      if (value < 0) {
+        value = 0;
+      }
+    }
+
+    layer.getContainerElement().getStyle().setProperty(prop, value, unit);
+  }
+}
=======================================
--- /releases/2.0/samples/mail/war/Mail.css     Mon Nov  9 11:00:52 2009
+++ /dev/null
@@ -1,54 +0,0 @@
-body, table {
-  font-size: small;
-}
-body {
-  font-family: Helvetica, Arial, sans-serif;
-  color: #000;
-  background: #fff;
-}
-a:link, a:visited, a:hover, a:active {
-  color: #000;
-  text-decoration: none;
-}
-
-/* Dialog boxes */
-.dialogTopLeftInner, .dialogMiddleLeftInner, .dialogBottomLeftInner,
-.dialogTopRightInner, .dialogMiddleRightInner, .dialogBottomRightInner {
-  display: none;
-}
-.gwt-DialogBox {
-  background-color: white;
-  border: 1px solid #666;
-}
-.gwt-DialogBox .Caption {
-  background: #d3d6dd url(gradient_bg_th.png) repeat-x bottom left;
-  font-weight: bold;
-  text-shadow: #fff 0 2px 2px;
-  cursor: default;
-  padding: 5px 10px;
-  border-bottom: 1px solid #999;
-  text-align: left;
-}
-.gwt-DialogBox .dialogContent {
-}
-.gwt-DialogBox .gwt-Button {
-  margin: 10px;
-}
-.gwt-PopupGlass {
-  background-color: #000;
-  opacity: 0.3;
-  filter: alpha(opacity=30);
-}
-
-/* GWT Tree */
-.gwt-Tree {
-}
-.gwt-Tree .gwt-TreeItem {
-  padding: 0;
-  cursor: hand;
-  cursor: pointer;
-  display: block !important;
-}
-.gwt-Tree .gwt-TreeItem-selected {
-  background: #ccc;
-}
=======================================
--- /releases/2.0/branch-info.txt       Tue Nov 10 10:15:57 2009
+++ /releases/2.0/branch-info.txt       Tue Nov 10 10:32:15 2009
@@ -485,4 +485,6 @@
  tr...@6796 was merged into this branch
    svn merge -c 6796 https://google-web-toolkit.googlecode.com/svn/trunk .

-
+tr...@6798, 6799, 6800 were merged into this branch
+  svn merge -r 6797:6800  
https://google-web-toolkit.googlecode.com/svn/trunk .
+
=======================================
--- /releases/2.0/samples/mail/src/com/google/gwt/sample/mail/Mail.gwt.xml      
 
Mon Nov  9 11:00:52 2009
+++ /releases/2.0/samples/mail/src/com/google/gwt/sample/mail/Mail.gwt.xml      
 
Tue Nov 10 10:32:15 2009
@@ -13,6 +13,11 @@
  <!-- limitations under the  
License.                                         -->

  <module rename-to="mail">
-       <inherits name='com.google.gwt.user.User'/>
-       <entry-point class='com.google.gwt.sample.mail.client.Mail'/>
+  <inherits name='com.google.gwt.user.User' />
+
+  <!-- This will give us shorter obfuscated CSS class names. We guarantee
+       that there will be no class names that will conflict with /M.+/ -->
+  <set-configuration-property name="CssResource.obfuscationPrefix"  
value="M" />
+
+  <entry-point class='com.google.gwt.sample.mail.client.Mail' />
  </module>
=======================================
---  
/releases/2.0/samples/mail/src/com/google/gwt/sample/mail/client/Contacts.java  
 
Tue Oct  6 14:10:56 2009
+++  
/releases/2.0/samples/mail/src/com/google/gwt/sample/mail/client/Contacts.java  
 
Tue Nov 10 10:32:15 2009
@@ -19,6 +19,7 @@
  import com.google.gwt.dom.client.Element;
  import com.google.gwt.event.dom.client.ClickEvent;
  import com.google.gwt.event.dom.client.ClickHandler;
+import com.google.gwt.resources.client.CssResource;
  import com.google.gwt.uibinder.client.UiBinder;
  import com.google.gwt.uibinder.client.UiField;
  import com.google.gwt.uibinder.client.UiTemplate;
@@ -69,6 +70,10 @@
    }

    interface Binder extends UiBinder<Widget, Contacts> { }
+  interface Style extends CssResource {
+    String item();
+  }
+
    private static final Binder binder = GWT.create(Binder.class);

    private Contact[] contacts = new Contact[] {
@@ -82,6 +87,7 @@
        new Contact("John von Neumann", "[email protected]")};

    @UiField ComplexPanel panel;
+  @UiField Style style;

    public Contacts() {
      initWidget(binder.createAndBindUi(this));
@@ -94,6 +100,7 @@

    private void addContact(final Contact contact) {
      final Anchor link = new Anchor(contact.name);
+    link.setStyleName(style.item());
      panel.add(link);

      // Add a click handler that displays a ContactPopup when it is clicked.
=======================================
---  
/releases/2.0/samples/mail/src/com/google/gwt/sample/mail/client/Contacts.ui.xml
         
Tue Oct  6 14:10:56 2009
+++  
/releases/2.0/samples/mail/src/com/google/gwt/sample/mail/client/Contacts.ui.xml
         
Tue Nov 10 10:32:15 2009
@@ -3,15 +3,17 @@
    xmlns:g='urn:import:com.google.gwt.user.client.ui'
    xmlns:mail='urn:import:com.google.gwt.sample.mail.client'>

-  <ui:style>
+  <ui:style field='style'
+    type='com.google.gwt.sample.mail.client.Contacts.Style'>
+
    .contacts {
      padding: 0.5em;
    }
+
+  .item {
+       display: block;
+       }
    </ui:style>

-  <!-- We need to apply padding to an outer panel because VerticalPanel is  
a
-       table, and applying padding to a table behaves strangely on IE6/7.  
-->
-  <g:FlowPanel styleName='{style.contacts}'>
-    <g:VerticalPanel ui:field='panel'/>
-  </g:FlowPanel>
+  <g:FlowPanel styleName='{style.contacts}' ui:field='panel'/>
  </ui:UiBinder>
=======================================
---  
/releases/2.0/samples/mail/src/com/google/gwt/sample/mail/client/Mail.java      
 
Wed Nov  4 07:24:16 2009
+++  
/releases/2.0/samples/mail/src/com/google/gwt/sample/mail/client/Mail.java      
 
Tue Nov 10 10:32:15 2009
@@ -19,6 +19,9 @@
  import com.google.gwt.core.client.GWT;
  import com.google.gwt.dom.client.Element;
  import com.google.gwt.dom.client.Style.Overflow;
+import com.google.gwt.resources.client.ClientBundle;
+import com.google.gwt.resources.client.CssResource;
+import com.google.gwt.resources.client.CssResource.NotStrict;
  import com.google.gwt.uibinder.client.UiBinder;
  import com.google.gwt.uibinder.client.UiField;
  import com.google.gwt.user.client.Window;
@@ -33,6 +36,13 @@
  public class Mail implements EntryPoint {

    interface Binder extends UiBinder<DockLayoutPanel, Mail> { }
+
+  interface GlobalResources extends ClientBundle {
+    @NotStrict
+    @Source("global.css")
+    CssResource css();
+  }
+
    private static final Binder binder = GWT.create(Binder.class);

    @UiField TopPanel topPanel;
@@ -45,6 +55,10 @@
     * controls and hooking up event handler.
     */
    public void onModuleLoad() {
+    // Inject global styles.
+     
GWT.<GlobalResources>create(GlobalResources.class).css().ensureInjected();
+
+    // Create the UI defined in Mail.ui.xml.
      DockLayoutPanel outer = binder.createAndBindUi(this);

      // Get rid of scrollbars, and clear out the window's built-in margin,
=======================================
---  
/releases/2.0/samples/mail/src/com/google/gwt/sample/mail/client/MailList.ui.xml
         
Mon Nov  9 11:00:52 2009
+++  
/releases/2.0/samples/mail/src/com/google/gwt/sample/mail/client/MailList.ui.xml
         
Tue Nov 10 10:32:15 2009
@@ -13,8 +13,9 @@
      cursor: hand;
    }

-  .header {
-    background: #d3d6dd url(gradient_bg_dark.png) repeat-x bottom left;
+  @sprite .header {
+       gwt-image: 'gradient';
+       background-color: #d3d6dd;
      table-layout: fixed;
      width: 100%;
      height: 100%;
=======================================
---  
/releases/2.0/samples/mail/src/com/google/gwt/sample/mail/client/Tasks.java     
 
Tue Sep 22 14:34:43 2009
+++  
/releases/2.0/samples/mail/src/com/google/gwt/sample/mail/client/Tasks.java     
 
Tue Nov 10 10:32:15 2009
@@ -15,24 +15,20 @@
   */
  package com.google.gwt.sample.mail.client;

-import com.google.gwt.user.client.ui.CheckBox;
+import com.google.gwt.core.client.GWT;
+import com.google.gwt.uibinder.client.UiBinder;
  import com.google.gwt.user.client.ui.Composite;
-import com.google.gwt.user.client.ui.VerticalPanel;
+import com.google.gwt.user.client.ui.Widget;

  /**
   * Composite that represents a collection of <code>Task</code> items.
   */
  public class Tasks extends Composite {

+  interface Binder extends UiBinder<Widget, Tasks> { }
+  private static final Binder binder = GWT.create(Binder.class);
+
    public Tasks() {
-    VerticalPanel list = new VerticalPanel();
-    list.add(new CheckBox("Get groceries"));
-    list.add(new CheckBox("Walk the dog"));
-    list.add(new CheckBox("Start Web 2.0 company"));
-    list.add(new CheckBox("Write cool app in GWT"));
-    list.add(new CheckBox("Get funding"));
-    list.add(new CheckBox("Take a vacation"));
-    initWidget(list);
-    setStyleName("mail-Tasks");
+    initWidget(binder.createAndBindUi(this));
    }
  }
=======================================
--- /releases/2.0/samples/mail/war/Mail.html    Tue Oct 13 16:57:19 2009
+++ /releases/2.0/samples/mail/war/Mail.html    Tue Nov 10 10:32:15 2009
@@ -17,7 +17,6 @@
  <html>
    <head>
      <meta http-equiv="content-type" content="text/html; charset=UTF-8">
-    <link type="text/css" rel='stylesheet' href='Mail.css'>
      <title>Mail App</title>
      <script type="text/javascript" language='javascript'  
src='mail/mail.nocache.js'></script>
    </head>
=======================================
--- /releases/2.0/user/src/com/google/gwt/layout/Layout.gwt.xml Tue Aug  4  
14:08:06 2009
+++ /releases/2.0/user/src/com/google/gwt/layout/Layout.gwt.xml Tue Nov 10  
10:32:15 2009
@@ -18,6 +18,11 @@
    <inherits name="com.google.gwt.dom.DOM"/>
    <inherits name="com.google.gwt.animation.Animation"/>

+  <replace-with class="com.google.gwt.layout.client.LayoutImplIE8">
+    <when-type-is class="com.google.gwt.layout.client.LayoutImpl"/>
+    <when-property-is name="user.agent" value="ie8"/>
+  </replace-with>
+
    <replace-with class="com.google.gwt.layout.client.LayoutImplIE6">
      <when-type-is class="com.google.gwt.layout.client.LayoutImpl"/>
      <when-property-is name="user.agent" value="ie6"/>
=======================================
--- /releases/2.0/user/src/com/google/gwt/layout/client/LayoutImpl.java Wed  
Nov  4 06:59:39 2009
+++ /releases/2.0/user/src/com/google/gwt/layout/client/LayoutImpl.java Tue  
Nov 10 10:32:15 2009
@@ -17,7 +17,6 @@

  import static com.google.gwt.dom.client.Style.Unit.EM;
  import static com.google.gwt.dom.client.Style.Unit.EX;
-import static com.google.gwt.dom.client.Style.Unit.IN;
  import static com.google.gwt.dom.client.Style.Unit.PX;

  import com.google.gwt.dom.client.DivElement;
@@ -42,9 +41,8 @@
    private static DivElement fixedRuler;

    static {
-    Document doc = Document.get();
-    fixedRuler = createRuler(IN, IN);
-    doc.getBody().appendChild(fixedRuler);
+    fixedRuler = createRuler(Unit.CM, Unit.CM);
+    Document.get().getBody().appendChild(fixedRuler);
    }

    protected static DivElement createRuler(Unit widthUnit, Unit heightUnit)  
{
@@ -111,15 +109,15 @@
        case EX:
          return relativeRuler.getOffsetHeight() / 10.0;
        case CM:
-        return fixedRuler.getOffsetWidth() / 10.0;
+        return fixedRuler.getOffsetWidth() * 0.1;     // 1.0    cm / cm
        case MM:
-        return fixedRuler.getOffsetWidth() / 100.0;
+        return fixedRuler.getOffsetWidth() * 0.01;    // 0.1    cm / mm
        case IN:
-        return fixedRuler.getOffsetWidth() / 25.4;
+        return fixedRuler.getOffsetWidth() * 0.254;   // 2.54   cm / in
        case PT:
-        return fixedRuler.getOffsetWidth() / 284;
+        return fixedRuler.getOffsetWidth() * 0.00353; // 0.0353 cm / pt
        case PC:
-        return fixedRuler.getOffsetWidth() / 23.6;
+        return fixedRuler.getOffsetWidth() * 0.0423;  // 0.423  cm / pc
        default:
        case PX:
          return 1;
@@ -150,7 +148,8 @@
      style = layer.child.getStyle();
      switch (layer.hPos) {
        case BEGIN:
-        style.clearLeft();
+        style.setLeft(0, Unit.PX);
+        style.clearRight();
          break;
        case END:
          style.clearLeft();
@@ -164,7 +163,8 @@

      switch (layer.vPos) {
        case BEGIN:
-        style.clearTop();
+        style.setTop(0, Unit.PX);
+        style.clearBottom();
          break;
        case END:
          style.clearTop();
=======================================
--- /releases/2.0/user/src/com/google/gwt/layout/client/LayoutImplIE6.java      
 
Wed Nov  4 06:59:39 2009
+++ /releases/2.0/user/src/com/google/gwt/layout/client/LayoutImplIE6.java      
 
Tue Nov 10 10:32:15 2009
@@ -36,7 +36,7 @@
   * Because this implementation gets compiled in for both IE6 and 7, it
   * dynamically detects IE7 and punts to the super implementation.
   */
-class LayoutImplIE6 extends LayoutImpl {
+class LayoutImplIE6 extends LayoutImplIE8 {

    private static boolean isIE6 = isIE6();

@@ -393,10 +393,8 @@
          switch (_hPos) {
            case 0: // BEGIN
              child.style.left = '0px';
-            child.style.width = '';
              break;
            case 1: // END
-            child.style.width = '';
              child.style.left = (container.offsetWidth - childDecoWidth -  
child.offsetWidth) + 'px';
              break;
            case 2: // STRETCH
@@ -409,10 +407,8 @@
          switch (_vPos) {
            case 0: // BEGIN
              child.style.top = '0px';
-            child.style.height = '';
              break;
            case 1: // END
-            child.style.height = '';
              child.style.top = (container.offsetHeight - childDecoHeight -  
child.offsetHeight) + 'px';
              break;
            case 2: // STRETCH
=======================================
---  
/releases/2.0/user/src/com/google/gwt/resources/css/CssGenerationVisitor.java   
 
Wed May 20 16:14:31 2009
+++  
/releases/2.0/user/src/com/google/gwt/resources/css/CssGenerationVisitor.java   
 
Tue Nov 10 10:32:15 2009
@@ -85,7 +85,7 @@
    public void endVisit(CssMediaRule x, Context ctx) {
      out.indentOut();
      out.print("}");
-    out.newline();
+    out.newlineOpt();
    }

    @Override
@@ -98,7 +98,7 @@
    public void endVisit(CssPageRule x, Context ctx) {
      out.indentOut();
      out.print("}");
-    out.newline();
+    out.newlineOpt();
    }

    @Override
@@ -274,7 +274,7 @@
    private void closeBrace() {
      out.indentOut();
      out.print('}');
-    out.newline();
+    out.newlineOpt();
    }

    private void colon() {
=======================================
--- /releases/2.0/user/test/com/google/gwt/layout/client/LayoutTest.java        
 
Mon Oct 12 13:35:17 2009
+++ /releases/2.0/user/test/com/google/gwt/layout/client/LayoutTest.java        
 
Tue Nov 10 10:32:15 2009
@@ -146,34 +146,35 @@
     * Tests child alignment within a layer.
     */
    public void testChildAlignment() {
-    child0.getStyle().setWidth(64, PX);
-    child0.getStyle().setHeight(128, PX);
-    layer0.setTopHeight(0, PX, 128, PX);
-    layer0.setLeftWidth(0, PX, 256, PX);
+    layer0.setLeftWidth(0, PX, 128, PX);
+    layer0.setTopHeight(0, PX, 256, PX);

      layer0.setChildHorizontalPosition(Alignment.STRETCH);
      layer0.setChildVerticalPosition(Alignment.STRETCH);
      layout.layout();
      assertEquals(0, child0.getOffsetLeft());
-    assertEquals(0, child1.getOffsetTop());
+    assertEquals(0, child0.getOffsetTop());
      assertEquals(128, child0.getOffsetWidth());
-    assertEquals(256, child1.getOffsetHeight());
+    assertEquals(256, child0.getOffsetHeight());
+
+    child0.getStyle().setWidth(64, PX);
+    child0.getStyle().setHeight(128, PX);

      layer0.setChildHorizontalPosition(Alignment.BEGIN);
      layer0.setChildVerticalPosition(Alignment.BEGIN);
      layout.layout();
      assertEquals(0, child0.getOffsetLeft());
-    assertEquals(0, child1.getOffsetTop());
+    assertEquals(0, child0.getOffsetTop());
      assertEquals(64, child0.getOffsetWidth());
-    assertEquals(128, child1.getOffsetHeight());
+    assertEquals(128, child0.getOffsetHeight());

      layer0.setChildHorizontalPosition(Alignment.END);
      layer0.setChildVerticalPosition(Alignment.END);
      layout.layout();
      assertEquals(64, child0.getOffsetLeft());
-    assertEquals(128, child1.getOffsetTop());
+    assertEquals(128, child0.getOffsetTop());
      assertEquals(64, child0.getOffsetWidth());
-    assertEquals(128, child1.getOffsetHeight());
+    assertEquals(128, child0.getOffsetHeight());
    }

    /**
@@ -276,6 +277,15 @@
      testHorizontalSplit(PC);
      testHorizontalSplit(PT);
      testHorizontalSplit(PX);
+
+    testVerticalSplit(CM);
+    testVerticalSplit(EM);
+    testVerticalSplit(EX);
+    testVerticalSplit(IN);
+    testVerticalSplit(MM);
+    testVerticalSplit(PC);
+    testVerticalSplit(PT);
+    testVerticalSplit(PX);
    }

    /**

--~--~---------~--~----~------------~-------~--~----~
http://groups.google.com/group/Google-Web-Toolkit-Contributors
-~----------~----~----~----~------~----~------~--~---

Reply via email to