(into bug978338) Bug 980014 - Allow new tab grid layout to reduce rows/columns if the window can't fit 3x3
Allow up to the maximum rows and columns and have layout flow the tiles without explicit rows.
Update height on init and on render (pref change).
The title extends 4px below the 16px margin because it's 20px tall.
Convert numbers to consts.
Move height/maxWidth setting after updating height.
Update height on load event
Fix code styling.
fix typo
Delay gGrid._render() until document loads to not need a separate height==0 check.
Fix the height for margin-top box because the spacer below will grow.
Include the extra bottom margin for the desired height.
Use computed height/width instead of hardcoded consts.
Refactor height calculations to _computeHeight
Compute available space without hardcoding margins.
Rename const to extra
Add 1px buffer for width.
Align margin-top height to be center with newtab toggle.
Wait until load/resize before sizing the grid while letting _render run immediately.
Switch to handleEvent and move size saving to "load" event.