Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1749)

Unified Diff: chrome/browser/resources/media_router/elements/media_router_container/media_router_container.js

Issue 2345773002: [MR UI] Handle fractional height for first-run-flow element (Closed)
Patch Set: Modify a comment Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/resources/media_router/elements/media_router_container/media_router_container.js
diff --git a/chrome/browser/resources/media_router/elements/media_router_container/media_router_container.js b/chrome/browser/resources/media_router/elements/media_router_container/media_router_container.js
index c7aba2c25dedbffc8bd016a2cfb48276d4884611..0d93b89bd27663976cc6d65250b0efec5259fee0 100644
--- a/chrome/browser/resources/media_router/elements/media_router_container/media_router_container.js
+++ b/chrome/browser/resources/media_router/elements/media_router_container/media_router_container.js
@@ -2317,9 +2317,12 @@ Polymer({
// Ensures that conditionally templated elements have finished stamping.
this.async(function() {
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') &&
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') &&
this.$$('#issue-banner').style.display != 'none' ?
this.$$('#issue-banner').offsetHeight : 0;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698