Baffled because of browser differences in setSizeFull() ...

I am sure this is something weird just with me. But if someone can shed some light on it, I will appreciate it.

I am seeing the UI of my simple Application differently on Safari and Firefox based on what I do to setSizeFull().

Here’s the code:

public class AdminMainWindow extends Application
    private final Window window = new Window();

    public void init()
        LoginForm login = new LoginForm();
        layout(window, login);
        login.addListener(new LoginForm.LoginListener() {   
            public void onLogin(LoginForm.LoginEvent event) {
                        "New Login",
                        "Username: " + event.getLoginParameter("username")
                                + ", password: "
                                + event.getLoginParameter("password"));
    private void layout(Window w, LoginForm lf) {
        VerticalLayout v = new VerticalLayout();
        OptionGroup og = new OptionGroup();
        og.addItem("Super User");

With this code, I see only the OptionGroup rendered on Safari whereas Firefox renders both LoginForm and OptionGroup. Is it just me?


Just to confirm that I see it as a problem with setFullSize() i.e. line# 14 in the code below, that when the line is commented out, the UI is rendered with both the components on both the browsers.

why you call login.setSizeFull(); if in two lines above you set the explicit W/H for the same component ?
calling setSizeFull() overrides your seytWidth / setHeight above, settings them to 100% both.

I think I have to do better at the layout, but the real question is about the browser differences.

Also, when I remove the setWidth/setHeight, the behaviour is still the same. Commenting out setSizeFull() makes Safari and Firefox behave the same way. With that line in there, only Firefox shows both LoginForm and OptionGroup.


To get a report of layouting problems in the currently visible layouts, enable debug mode by adding ?debug to your application URL, and use the Analyze layouts button to see the report.

For more information about the debug mode and analyze layouts, see section
from the Book of Vaadin. Also, section
about layout formatting may be good reading :slight_smile:


As Henri pointed out, there’s an invalid layout configuration at play here. You’re using a relatively sized component inside an undefined sized layout, which results in zero sizes for the contained component (in most cases). But since these invalid situations are impossible to figure out exactly what the expected result would be, the behavior is undefined by the Vaadin layout specification.

And because of that, browser differences are let loose to handle the situation pretty much as they see fit. Safari renders the view as I would expect, where a 100% high element inside an undefined DIV is rendered 0px high, whereas Firefox probably applies some security exceptions and makes the otherwise hidden IFRAME visible (which is used to render the LoginForm).

That’s expected as well, since


is just a shorthand method for


hence overriding any previously set width and height.