@Override
public void apply() throws Exception {
GwtState state = m_rootPanel.getState();
Dimension size = getSize();
// prepare Shell
IBrowserShell shell = state.getShell();
shell.prepare();
// set Shell size
{
Rectangle shellBounds = shell.computeTrim(0, 0, size.width, size.height);
if (state.isStrictMode() && !state.isBrowserWebKit()) {
shellBounds.width += SIZE_EXPAND;
shellBounds.height += SIZE_EXPAND;
}
shell.setSize(shellBounds.width, shellBounds.height);
}
// in "strict" mode RootPanel (i.e. "body") has size required by widgets, so force size
if (state.isStrictMode()) {
Insets margins = state.getMargins(m_rootPanel.getElement());
Insets borders = state.getBorders(m_rootPanel.getElement());