Dialog rendering

Hi, I have a question about dialog rendering. If I want to add a layout(in my case ContentLayout) to dialog finally I have two divs.

For example

class SettingsDialog : Dialog() {

    init {
        render()
    }

    private fun render() {
        removeAll()
        add(TitleLayout(), ContentLayout(), ButtonsLayout(this))
    }
}
class ContentLayout : VerticalLayout() {

    init {
        render()
    }

    private fun render() {
        add(ViewerWrapper().apply { turnOffToolBarPanel() })
    }
}

And I have two ContentLayout divs in the Dialog. On the other hand if I add ContentLayout() to HorizontalLayout instead the dialog everything is ok and I have only one div.

Is it bug or feature of the dialog rendering?