From 573a2e815015c5b347daf2fd5e1af8f6d75c5601 Mon Sep 17 00:00:00 2001 From: Justin Ridgewell Date: Tue, 8 Jan 2019 15:55:33 -0500 Subject: [PATCH] Use getBoundingClientRect.height --- src/service/viewport/viewport-binding-ios-embed-sd.js | 3 ++- src/service/viewport/viewport-binding-ios-embed-wrapper.js | 3 ++- src/service/viewport/viewport-binding-natural.js | 3 ++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/service/viewport/viewport-binding-ios-embed-sd.js b/src/service/viewport/viewport-binding-ios-embed-sd.js index d4caf7ea51e8..ff205ce916f0 100644 --- a/src/service/viewport/viewport-binding-ios-embed-sd.js +++ b/src/service/viewport/viewport-binding-ios-embed-sd.js @@ -397,8 +397,9 @@ export class ViewportBindingIosEmbedShadowRoot_ { /** @override */ getContentHeight() { const scrollingElement = this.wrapper_; + const rect = scrollingElement./*OK*/getBoundingClientRect(); const style = getComputedStyle(scrollingElement); - return scrollingElement./*OK*/scrollHeight + return rect.height + this.paddingTop_ + this.getBorderTop() + parseInt(style.marginTop, 10) diff --git a/src/service/viewport/viewport-binding-ios-embed-wrapper.js b/src/service/viewport/viewport-binding-ios-embed-wrapper.js index 374349e0af4c..f0e836f04c26 100644 --- a/src/service/viewport/viewport-binding-ios-embed-wrapper.js +++ b/src/service/viewport/viewport-binding-ios-embed-wrapper.js @@ -235,8 +235,9 @@ export class ViewportBindingIosEmbedWrapper_ { /** @override */ getContentHeight() { const scrollingElement = this.wrapper_; + const rect = scrollingElement./*OK*/getBoundingClientRect(); const style = getComputedStyle(scrollingElement); - return scrollingElement./*OK*/scrollHeight + return rect.height + this.getBorderTop() + parseInt(style.marginTop, 10) + parseInt(style.marginBottom, 10); diff --git a/src/service/viewport/viewport-binding-natural.js b/src/service/viewport/viewport-binding-natural.js index 99a791e3bc93..ad6a506a4ed5 100644 --- a/src/service/viewport/viewport-binding-natural.js +++ b/src/service/viewport/viewport-binding-natural.js @@ -196,8 +196,9 @@ export class ViewportBindingNatural_ { /** @override */ getContentHeight() { const scrollingElement = this.getScrollingElement(); + const rect = scrollingElement./*OK*/getBoundingClientRect(); const style = getComputedStyle(scrollingElement); - return scrollingElement./*OK*/scrollHeight + return rect.height + parseInt(style.marginTop, 10) + parseInt(style.marginBottom, 10); }