From c0f52b82b43735e888be9889a9fe95c68cf806b2 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Leif=20=C3=85strand?= Date: Fri, 16 Mar 2012 16:41:17 +0200 Subject: [PATCH] Only prevent margin collapse if embedded --- .../VAADIN/themes/base/common/common.css | 7 +++-- .../terminal/gwt/client/ui/RootConnector.java | 3 ++ ...eddedClickListenerRelativeCoordinates.html | 31 ++----------------- 3 files changed, 10 insertions(+), 31 deletions(-) diff --git a/WebContent/VAADIN/themes/base/common/common.css b/WebContent/VAADIN/themes/base/common/common.css index 41184f579c..a95f33afcd 100644 --- a/WebContent/VAADIN/themes/base/common/common.css +++ b/WebContent/VAADIN/themes/base/common/common.css @@ -32,11 +32,12 @@ div.v-app-loading { overflow: auto; /* avoid scrollbars with margins in root layout */ outline: none; + position: relative; +} +/* Prevent margin collapse */ +.v-view.v-view-embedded { margin-top: -1px; border-top: 1px solid transparent; - position: relative; - box-sizing: border-box; - -moz-box-sizing: border-box; } /** * Try to handle printing somehow. Reasonable printing support diff --git a/src/com/vaadin/terminal/gwt/client/ui/RootConnector.java b/src/com/vaadin/terminal/gwt/client/ui/RootConnector.java index 45a010a0f1..086ded1743 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/RootConnector.java +++ b/src/com/vaadin/terminal/gwt/client/ui/RootConnector.java @@ -64,6 +64,9 @@ public class RootConnector extends AbstractComponentContainerConnector styles += style + " "; } } + if (!client.getConfiguration().isStandalone()) { + styles += getWidget().getStylePrimaryName() + "-embedded"; + } getWidget().setStyleName(styles.trim()); clickEventHandler.handleEventHandlerRegistration(client); diff --git a/tests/testbench/com/vaadin/tests/components/embedded/EmbeddedClickListenerRelativeCoordinates.html b/tests/testbench/com/vaadin/tests/components/embedded/EmbeddedClickListenerRelativeCoordinates.html index 3afb322a22..2dcd1b5071 100644 --- a/tests/testbench/com/vaadin/tests/components/embedded/EmbeddedClickListenerRelativeCoordinates.html +++ b/tests/testbench/com/vaadin/tests/components/embedded/EmbeddedClickListenerRelativeCoordinates.html @@ -16,39 +16,24 @@ /run/com.vaadin.tests.components.embedded.EmbeddedClickListenerRelativeCoordinates?restartApplication - - waitForVaadin - - - mouseClick vaadin=runcomvaadintestscomponentsembeddedEmbeddedClickListenerRelativeCoordinates::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VEmbedded[0]/domChild[0] 41,22 - waitForVaadin - - - - - screenCapture - - click-41-22 - - + mouseClick vaadin=runcomvaadintestscomponentsembeddedEmbeddedClickListenerRelativeCoordinates::Root/VNotification[0] 0,0 - waitForVaadin - + waitForElementNotPresent + vaadin=runcomvaadintestscomponentsembeddedEmbeddedClickListenerRelativeCoordinates::Root/VNotification[0]/HTML[0]/domChild[0] @@ -57,19 +42,9 @@ 0,0 - waitForVaadin - - - - - - screenCapture - - click-0-0 -- 2.39.5