Commit 99ee961a authored by takumif's avatar takumif Committed by Commit bot

[MR UI] Handle fractional height for first-run-flow element

The first run flow div, whose height is not hard-coded, has a fractional height value, which is also used as the top margin size for the header below it. By keeping it fractional rather than rounding by using offsetHeight, we avoid rounding errors.

BUG=615373
CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:closure_compilation

Review-Url: https://codereview.chromium.org/2345773002
Cr-Commit-Position: refs/heads/master@{#419213}
parent 0d2564eb
...@@ -2317,9 +2317,12 @@ Polymer({ ...@@ -2317,9 +2317,12 @@ Polymer({
// Ensures that conditionally templated elements have finished stamping. // Ensures that conditionally templated elements have finished stamping.
this.async(function() { this.async(function() {
var headerHeight = this.header.offsetHeight; var headerHeight = this.header.offsetHeight;
// Unlike the other elements whose heights are fixed, the first-run-flow
// element can have a fractional height. So we use getBoundingClientRect()
// to avoid rounding errors.
var firstRunFlowHeight = this.$$('#first-run-flow') && var firstRunFlowHeight = this.$$('#first-run-flow') &&
this.$$('#first-run-flow').style.display != 'none' ? this.$$('#first-run-flow').style.display != 'none' ?
this.$$('#first-run-flow').offsetHeight : 0; this.$$('#first-run-flow').getBoundingClientRect().height : 0;
var issueHeight = this.$$('#issue-banner') && var issueHeight = this.$$('#issue-banner') &&
this.$$('#issue-banner').style.display != 'none' ? this.$$('#issue-banner').style.display != 'none' ?
this.$$('#issue-banner').offsetHeight : 0; this.$$('#issue-banner').offsetHeight : 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment