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

Unified Diff: extensions/renderer/resources/guest_view/guest_view_container.js

Issue 997153004: GuestView: Use computed size if getBoundingClientRect() size is unavailable. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased Created 5 years, 9 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: extensions/renderer/resources/guest_view/guest_view_container.js
diff --git a/extensions/renderer/resources/guest_view/guest_view_container.js b/extensions/renderer/resources/guest_view/guest_view_container.js
index 35c6991039cec6152b94e483f75a1c3e0cc547fa..a0df2a56470265ec6db5b5dc7dc0fa4eee4fb2d5 100644
--- a/extensions/renderer/resources/guest_view/guest_view_container.js
+++ b/extensions/renderer/resources/guest_view/guest_view_container.js
@@ -157,9 +157,12 @@ GuestViewContainer.prototype.onElementResize = function(oldWidth, oldHeight,
GuestViewContainer.prototype.buildParams = function() {
var params = this.buildContainerParams();
params['instanceId'] = this.viewInstanceId;
+ var css = window.getComputedStyle(this.element, null);
paulmeyer 2015/03/24 20:57:00 I think it would be useful to add a comment here a
Fady Samuel 2015/03/26 17:50:38 Done.
var elementRect = this.element.getBoundingClientRect();
- params['elementWidth'] = parseInt(elementRect.width);
- params['elementHeight'] = parseInt(elementRect.height);
+ params['elementWidth'] = parseInt(elementRect.width) ||
+ parseInt(css.getPropertyValue('width'));
+ params['elementHeight'] = parseInt(elementRect.height) ||
+ parseInt(css.getPropertyValue('height'));
return params;
};
« 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