]> source.dussan.org Git - vaadin-framework.git/commitdiff
Merge from 6.8: Limit propagation of vertical spacing and margins in 25/25/1
authorHenri Sara <hesara@vaadin.com>
Mon, 1 Oct 2012 11:06:43 +0000 (14:06 +0300)
committerHenri Sara <hesara@vaadin.com>
Mon, 1 Oct 2012 11:06:43 +0000 (14:06 +0300)
nested FormLayouts, related test (#9427)

svn changeset:24503/svn branch:6.8
svn changeset:24504/svn branch:6.8
svn changeset:24506/svn branch:6.8

Change-Id: I7eca0fccdd9fc9258514c68025bd9e99dcc0b89d

WebContent/VAADIN/themes/base/formlayout/formlayout.scss
WebContent/VAADIN/themes/reindeer/formlayout/formlayout.scss
WebContent/VAADIN/themes/runo/formlayout/formlayout.scss
uitest/src/com/vaadin/tests/components/formlayout/NestedFormLayouts.html [new file with mode: 0644]
uitest/src/com/vaadin/tests/components/formlayout/NestedFormLayouts.java [new file with mode: 0644]

index a45840ebabdd165cdb87a4cfd199106349cc6304..258a8e3f157a42c09d20267aaf5bb9d42a12a487 100644 (file)
 .v-formlayout-captioncell .v-caption {
        overflow: visible;
 }
-.v-formlayout-spacing .v-formlayout-row .v-formlayout-captioncell, 
-.v-formlayout-spacing .v-formlayout-row .v-formlayout-contentcell,
-.v-formlayout-spacing .v-formlayout-row .v-formlayout-errorcell {
+.v-formlayout-spacing > tbody > .v-formlayout-row > .v-formlayout-captioncell, 
+.v-formlayout-spacing > tbody > .v-formlayout-row > .v-formlayout-contentcell,
+.v-formlayout-spacing > tbody > .v-formlayout-row > .v-formlayout-errorcell {
        padding-top: 6px;
 }
-.v-formlayout-spacing .v-formlayout-firstrow .v-formlayout-captioncell, 
-.v-formlayout-spacing .v-formlayout-firstrow .v-formlayout-contentcell,
-.v-formlayout-spacing .v-formlayout-firstrow .v-formlayout-errorcell {
+.v-formlayout-spacing > tbody > .v-formlayout-firstrow > .v-formlayout-captioncell, 
+.v-formlayout-spacing > tbody > .v-formlayout-firstrow > .v-formlayout-contentcell,
+.v-formlayout-spacing > tbody > .v-formlayout-firstrow > .v-formlayout-errorcell {
        padding-top: 0;
 }
-.v-formlayout-margin-top .v-formlayout-firstrow .v-formlayout-captioncell, 
-.v-formlayout-margin-top .v-formlayout-firstrow .v-formlayout-contentcell,
-.v-formlayout-margin-top .v-formlayout-firstrow .v-formlayout-errorcell {
+.v-formlayout-margin-top > tbody > .v-formlayout-firstrow > .v-formlayout-captioncell, 
+.v-formlayout-margin-top > tbody > .v-formlayout-firstrow > .v-formlayout-contentcell,
+.v-formlayout-margin-top > tbody > .v-formlayout-firstrow > .v-formlayout-errorcell {
        padding-top: 12px;
 }
-.v-formlayout-margin-bottom .v-formlayout-lastrow .v-formlayout-captioncell,
-.v-formlayout-margin-bottom .v-formlayout-lastrow .v-formlayout-contentcell,
-.v-formlayout-margin-bottom .v-formlayout-lastrow .v-formlayout-errorcell {
+.v-formlayout-margin-bottom > tbody > .v-formlayout-lastrow > .v-formlayout-captioncell,
+.v-formlayout-margin-bottom > tbody > .v-formlayout-lastrow > .v-formlayout-contentcell,
+.v-formlayout-margin-bottom > tbody > .v-formlayout-lastrow > .v-formlayout-errorcell {
        padding-bottom: 12px;
 }
-.v-formlayout-margin-left .v-formlayout-captioncell {
+.v-formlayout-margin-left > tbody > .v-formlayout-row > .v-formlayout-captioncell {
        padding-left: 12px;
 } 
-.v-formlayout-margin-right .v-formlayout-contentcell {
+.v-formlayout-margin-right > tbody > .v-formlayout-row > .v-formlayout-contentcell {
        padding-right: 12px;
 }
 .v-formlayout-captioncell .v-caption .v-required-field-indicator {
index ab47767dcfe1d06cb01b19f58a6fdd0022a68df3..e73340fd3b57439e3a44282096b57697992ea535 100644 (file)
        text-align: right;
        white-space: nowrap;
 }
-.v-formlayout-spacing .v-formlayout-row .v-formlayout-captioncell, 
-.v-formlayout-spacing .v-formlayout-row .v-formlayout-contentcell,
-.v-formlayout-spacing .v-formlayout-row .v-formlayout-errorcell {
+.v-formlayout-spacing > tbody > .v-formlayout-row > .v-formlayout-captioncell, 
+.v-formlayout-spacing > tbody > .v-formlayout-row > .v-formlayout-contentcell,
+.v-formlayout-spacing > tbody > .v-formlayout-row > .v-formlayout-errorcell {
        padding-top: 8px;
 }
-.v-formlayout-margin-top .v-formlayout-firstrow .v-formlayout-captioncell, 
-.v-formlayout-margin-top .v-formlayout-firstrow .v-formlayout-contentcell,
-.v-formlayout-margin-top .v-formlayout-firstrow .v-formlayout-errorcell {
+.v-formlayout-margin-top > tbody > .v-formlayout-firstrow > .v-formlayout-captioncell, 
+.v-formlayout-margin-top > tbody > .v-formlayout-firstrow > .v-formlayout-contentcell,
+.v-formlayout-margin-top > tbody > .v-formlayout-firstrow > .v-formlayout-errorcell {
        padding-top: 15px;
 }
-.v-formlayout-margin-bottom .v-formlayout-lastrow .v-formlayout-captioncell,
-.v-formlayout-margin-bottom .v-formlayout-lastrow .v-formlayout-contentcell,
-.v-formlayout-margin-bottom .v-formlayout-lastrow .v-formlayout-errorcell {
+.v-formlayout-margin-bottom > tbody > .v-formlayout-lastrow > .v-formlayout-captioncell,
+.v-formlayout-margin-bottom > tbody > .v-formlayout-lastrow > .v-formlayout-contentcell,
+.v-formlayout-margin-bottom > tbody > .v-formlayout-lastrow > .v-formlayout-errorcell {
        padding-bottom: 15px;
 }
-.v-formlayout-margin-left .v-formlayout-captioncell {
+.v-formlayout-margin-left > tbody > .v-formlayout-row > .v-formlayout-captioncell {
        padding-left: 18px;
 } 
-.v-formlayout-margin-right .v-formlayout-contentcell {
+.v-formlayout-margin-right > tbody > .v-formlayout-row > .v-formlayout-contentcell {
        padding-right: 18px;
 }
 /* form */
index 0766269d8bce26ffb7675bdfcb9f0e1855b3c6f9..bb27da1d5bbc667be4af4383b9a3f74b1073629e 100644 (file)
@@ -9,25 +9,25 @@
        text-align:right;
        white-space: nowrap;
 }
-.v-formlayout-spacing .v-formlayout-row .v-formlayout-captioncell, 
-.v-formlayout-spacing .v-formlayout-row .v-formlayout-contentcell,
-.v-formlayout-spacing .v-formlayout-row .v-formlayout-errorcell {
+.v-formlayout-spacing > tbody > .v-formlayout-row > .v-formlayout-captioncell, 
+.v-formlayout-spacing > tbody > .v-formlayout-row > .v-formlayout-contentcell,
+.v-formlayout-spacing > tbody > .v-formlayout-row > .v-formlayout-errorcell {
        padding-top: 8px;
 }
-.v-formlayout-margin-top .v-formlayout-firstrow .v-formlayout-captioncell, 
-.v-formlayout-margin-top .v-formlayout-firstrow .v-formlayout-contentcell,
-.v-formlayout-margin-top .v-formlayout-firstrow .v-formlayout-errorcell {
+.v-formlayout-margin-top > tbody > .v-formlayout-firstrow > .v-formlayout-captioncell, 
+.v-formlayout-margin-top > tbody > .v-formlayout-firstrow > .v-formlayout-contentcell,
+.v-formlayout-margin-top > tbody > .v-formlayout-firstrow > .v-formlayout-errorcell {
        padding-top: 15px;
 }
-.v-formlayout-margin-bottom .v-formlayout-lastrow .v-formlayout-captioncell,
-.v-formlayout-margin-bottom .v-formlayout-lastrow .v-formlayout-contentcell,
-.v-formlayout-margin-bottom .v-formlayout-lastrow .v-formlayout-errorcell {
+.v-formlayout-margin-bottom > tbody > .v-formlayout-lastrow > .v-formlayout-captioncell,
+.v-formlayout-margin-bottom > tbody > .v-formlayout-lastrow > .v-formlayout-contentcell,
+.v-formlayout-margin-bottom > tbody > .v-formlayout-lastrow > .v-formlayout-errorcell {
        padding-bottom: 15px;
 }
-.v-formlayout-margin-left .v-formlayout-captioncell {
+.v-formlayout-margin-left > tbody > .v-formlayout-row > .v-formlayout-captioncell {
        padding-left: 18px;
 } 
-.v-formlayout-margin-right .v-formlayout-contentcell {
+.v-formlayout-margin-right > tbody > .v-formlayout-row > .v-formlayout-contentcell {
        padding-right: 18px;
 }
 /* form */
diff --git a/uitest/src/com/vaadin/tests/components/formlayout/NestedFormLayouts.html b/uitest/src/com/vaadin/tests/components/formlayout/NestedFormLayouts.html
new file mode 100644 (file)
index 0000000..a95aeca
--- /dev/null
@@ -0,0 +1,56 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head profile="http://selenium-ide.openqa.org/profiles/test-case">
+<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+<link rel="selenium.base" href="" />
+<title>NestedFormLayouts</title>
+</head>
+<body>
+<table cellpadding="1" cellspacing="1" border="1">
+<thead>
+<tr><td rowspan="1" colspan="3">NestedFormLayouts</td></tr>
+</thead><tbody>
+<tr>
+       <td>open</td>
+       <td>/run/com.vaadin.tests.components.formlayout.NestedFormLayouts?restartApplication</td>
+       <td></td>
+</tr>
+<tr>
+       <td>screenCapture</td>
+       <td></td>
+       <td>initial</td>
+</tr>
+<tr>
+       <td>mouseClick</td>
+       <td>vaadin=runcomvaadintestscomponentsformlayoutNestedFormLayouts::PID_Sspacings/domChild[0]</td>
+       <td>8,8</td>
+</tr>
+<tr>
+       <td>screenCapture</td>
+       <td></td>
+       <td>spacings</td>
+</tr>
+<tr>
+       <td>mouseClick</td>
+       <td>vaadin=runcomvaadintestscomponentsformlayoutNestedFormLayouts::PID_Smargins/domChild[0]</td>
+       <td>5,4</td>
+</tr>
+<tr>
+       <td>screenCapture</td>
+       <td></td>
+       <td>spacings_margins</td>
+</tr>
+<tr>
+       <td>mouseClick</td>
+       <td>vaadin=runcomvaadintestscomponentsformlayoutNestedFormLayouts::PID_Sspacings/domChild[0]</td>
+       <td>8,5</td>
+</tr>
+<tr>
+       <td>screenCapture</td>
+       <td></td>
+       <td>margins</td>
+</tr>
+</tbody></table>
+</body>
+</html>
diff --git a/uitest/src/com/vaadin/tests/components/formlayout/NestedFormLayouts.java b/uitest/src/com/vaadin/tests/components/formlayout/NestedFormLayouts.java
new file mode 100644 (file)
index 0000000..147f2dc
--- /dev/null
@@ -0,0 +1,117 @@
+package com.vaadin.tests.components.formlayout;
+
+import com.vaadin.data.Property.ValueChangeEvent;
+import com.vaadin.data.Property.ValueChangeListener;
+import com.vaadin.server.VaadinRequest;
+import com.vaadin.tests.components.AbstractTestUI;
+import com.vaadin.ui.CheckBox;
+import com.vaadin.ui.FormLayout;
+import com.vaadin.ui.Label;
+
+public class NestedFormLayouts extends AbstractTestUI {
+
+    private FormLayout outer;
+    private FormLayout inner1;
+    private FormLayout inner2;
+    private FormLayout inner21;
+    private FormLayout inner3;
+    private FormLayout inner31;
+    private FormLayout inner4;
+
+    @Override
+    protected void setup(VaadinRequest request) {
+        outer = new FormLayout();
+        outer.setSizeUndefined();
+        outer.setWidth("100%");
+
+        inner1 = new FormLayout();
+        inner1.addComponent(new Label("Test"));
+        inner1.addComponent(new Label("Test2"));
+        outer.addComponent(inner1);
+
+        outer.addComponent(new Label("Test"));
+        outer.addComponent(new Label("Test2"));
+
+        inner2 = new FormLayout();
+        inner2.addComponent(new Label("Test"));
+        inner2.addComponent(new Label("Test2"));
+        inner21 = new FormLayout();
+        inner21.addComponent(new Label("Test"));
+        inner21.addComponent(new Label("Test2"));
+        inner2.addComponent(inner21);
+        outer.addComponent(inner2);
+
+        inner3 = new FormLayout();
+        inner3.addComponent(new Label("Test"));
+        inner3.addComponent(new Label("Test2"));
+        // this layout never gets spacing or margin
+        inner31 = new FormLayout();
+        inner31.addComponent(new Label("Test"));
+        inner31.addComponent(new Label("Test2"));
+        inner31.setSpacing(false);
+        inner31.setMargin(false);
+        inner3.addComponent(inner31);
+        outer.addComponent(inner3);
+
+        inner4 = new FormLayout();
+        inner4.addComponent(new Label("Test"));
+        inner4.addComponent(new Label("Test2"));
+        outer.addComponent(inner4);
+
+        addComponent(outer);
+
+        final CheckBox spacingCheckBox = new CheckBox("Spacings", false);
+        spacingCheckBox.setId("spacings");
+        spacingCheckBox.setImmediate(true);
+        spacingCheckBox.addValueChangeListener(new ValueChangeListener() {
+            @Override
+            public void valueChange(ValueChangeEvent event) {
+                setLayoutSpacing(spacingCheckBox.getValue());
+            }
+        });
+        addComponent(spacingCheckBox);
+
+        final CheckBox marginCheckBox = new CheckBox("Margins", false);
+        marginCheckBox.setId("margins");
+        marginCheckBox.setImmediate(true);
+        marginCheckBox.addValueChangeListener(new ValueChangeListener() {
+            @Override
+            public void valueChange(ValueChangeEvent event) {
+                setLayoutMargin(marginCheckBox.getValue());
+            }
+        });
+        addComponent(marginCheckBox);
+
+        setLayoutSpacing(false);
+        setLayoutMargin(false);
+    }
+
+    private void setLayoutSpacing(boolean value) {
+        outer.setSpacing(value);
+        inner1.setSpacing(value);
+        inner2.setSpacing(value);
+        inner21.setSpacing(value);
+        inner3.setSpacing(value);
+        inner4.setSpacing(value);
+    }
+
+    private void setLayoutMargin(boolean value) {
+        outer.setMargin(value);
+        inner1.setMargin(value);
+        inner2.setMargin(value);
+        inner21.setMargin(value);
+        inner3.setMargin(value);
+        inner4.setMargin(value);
+    }
+
+    @Override
+    protected String getTestDescription() {
+        return "Excess padding applied in FormLayouts nested as first or last rows in a FormLayout";
+    }
+
+    @Override
+    protected Integer getTicketNumber() {
+        return 9427;
+    }
+
+}