diff options
author | Leif Åstrand <leif@vaadin.com> | 2012-03-16 16:41:17 +0200 |
---|---|---|
committer | Leif Åstrand <leif@vaadin.com> | 2012-03-16 16:42:18 +0200 |
commit | c0f52b82b43735e888be9889a9fe95c68cf806b2 (patch) | |
tree | ac46bb9a98d256230c7e941387b24e1e7e3964b4 | |
parent | ce24fb4f0289cf8bb8841d397ccb214189530905 (diff) | |
download | vaadin-framework-c0f52b82b43735e888be9889a9fe95c68cf806b2.tar.gz vaadin-framework-c0f52b82b43735e888be9889a9fe95c68cf806b2.zip |
Only prevent margin collapse if embedded
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 @@ -17,38 +17,23 @@ <td></td> </tr> <tr> - <td>waitForVaadin</td> - <td></td> - <td></td> -</tr> -<tr> <td>mouseClick</td> <td>vaadin=runcomvaadintestscomponentsembeddedEmbeddedClickListenerRelativeCoordinates::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VEmbedded[0]/domChild[0]</td> <td>41,22</td> </tr> <tr> - <td>waitForVaadin</td> - <td></td> - <td></td> -</tr> -<tr> - <td>screenCapture</td> - <td></td> - <td>click-41-22</td> -</tr> -<!-- Should really be 41,22 but due to v-view border-top it is not always... <tr> <td>assertText</td> <td>vaadin=runcomvaadintestscomponentsembeddedEmbeddedClickListenerRelativeCoordinates::Root/VNotification[0]/HTML[0]/domChild[0]</td> <td>41, 22</td> -</tr>--> +</tr> <tr> <td>mouseClick</td> <td>vaadin=runcomvaadintestscomponentsembeddedEmbeddedClickListenerRelativeCoordinates::Root/VNotification[0]</td> <td>0,0</td> </tr> <tr> - <td>waitForVaadin</td> - <td></td> + <td>waitForElementNotPresent</td> + <td>vaadin=runcomvaadintestscomponentsembeddedEmbeddedClickListenerRelativeCoordinates::Root/VNotification[0]/HTML[0]/domChild[0]</td> <td></td> </tr> <tr> @@ -57,19 +42,9 @@ <td>0,0</td> </tr> <tr> - <td>waitForVaadin</td> - <td></td> - <td></td> -</tr> -<!-- Should really be 0,0 but due to v-view border-top it is not always... <tr> <td>assertText</td> <td>vaadin=runcomvaadintestscomponentsembeddedEmbeddedClickListenerRelativeCoordinates::Root/VNotification[0]/HTML[0]/domChild[0]</td> <td>0, 0</td> -</tr>--> -<tr> - <td>screenCapture</td> - <td></td> - <td>click-0-0</td> </tr> </tbody></table> </body> |