summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--WebContent/VAADIN/themes/base/label/label.css3
-rw-r--r--tests/testbench/com/vaadin/tests/components/gridlayout/MarginsInLabels.java50
2 files changed, 53 insertions, 0 deletions
diff --git a/WebContent/VAADIN/themes/base/label/label.css b/WebContent/VAADIN/themes/base/label/label.css
new file mode 100644
index 0000000000..366dbdf26f
--- /dev/null
+++ b/WebContent/VAADIN/themes/base/label/label.css
@@ -0,0 +1,3 @@
+.v-label {
+ overflow: hidden;
+} \ No newline at end of file
diff --git a/tests/testbench/com/vaadin/tests/components/gridlayout/MarginsInLabels.java b/tests/testbench/com/vaadin/tests/components/gridlayout/MarginsInLabels.java
new file mode 100644
index 0000000000..1cbed2a17d
--- /dev/null
+++ b/tests/testbench/com/vaadin/tests/components/gridlayout/MarginsInLabels.java
@@ -0,0 +1,50 @@
+package com.vaadin.tests.components.gridlayout;
+
+import com.vaadin.terminal.WrappedRequest;
+import com.vaadin.tests.components.AbstractTestRoot;
+import com.vaadin.ui.AbstractLayout;
+import com.vaadin.ui.Accordion;
+import com.vaadin.ui.GridLayout;
+import com.vaadin.ui.Label;
+import com.vaadin.ui.Label.ContentMode;
+import com.vaadin.ui.TabSheet;
+import com.vaadin.ui.VerticalLayout;
+
+public class MarginsInLabels extends AbstractTestRoot {
+
+ @Override
+ protected void setup(WrappedRequest request) {
+ AbstractLayout layout = new VerticalLayout();
+ layout.addComponent(new Label("<h1>Vertical layout</h1>",
+ ContentMode.XHTML));
+ layout.addComponent(new Label("Next row"));
+ addComponent(layout);
+
+ layout = new GridLayout(1, 2);
+ layout.setWidth("100%");
+ layout.addComponent(new Label("<h1>Grid layout</h1>", ContentMode.XHTML));
+ layout.addComponent(new Label("Next row"));
+ addComponent(layout);
+
+ TabSheet tabSheet = new TabSheet();
+ tabSheet.addTab(new Label("<h1>Tabsheet</h1>", ContentMode.XHTML),
+ "Label");
+ addComponent(tabSheet);
+
+ Accordion accordion = new Accordion();
+ accordion.addTab(new Label("<h1>Accordion</h1>", ContentMode.XHTML),
+ "Label");
+ addComponent(accordion);
+ }
+
+ @Override
+ protected String getTestDescription() {
+ return "Margins inside labels should not be allowed to collapse out of the label as it causes problems with layotus measuring the label.";
+ }
+
+ @Override
+ protected Integer getTicketNumber() {
+ return Integer.valueOf(8671);
+ }
+
+}