0

I'm building a Chrome Packaged App with WebGL and Three.js, with the goal of making a prototype for a 3-D browser. I am using the CSS3D renderer to render a dynamically-created webview element onto a Three.js plane surface. I've gotten this to work when creating an iframe element, but when I use a webview, I get the following result:

Notice how it doesn't fill the space

The code I'm using to create the webview is:

var webview = document.createElement('webview');
webview.setAttribute('src', 'url erased to protect identity');
webview.style.width = '100%';
webview.style.height = '100%';
element.appendChild(webview);

Where element is a div element that is properly scaled to fit on the plane.

How do I make the webview element stretch to fill the parent div?

EDIT: The method displayed in the answer to Chrome webview height issue had no visible effect for me.

EDIT 2: I looked at the answer to Why can't I make my div 100% height and looked at it. The really curious thing is that it's not even obvious from the developer tools why it's not working. Here's a screenshot of the developer tools showing the page:

Apparently Chrome thinks it's taking that whole space?

It looks to me like Chrome thinks the webview is taking that whole space. I honestly don't understand what's going on here. Any explanation is greatly appreciated.

Community
  • 1
  • 1
moosingin3space
  • 326
  • 2
  • 5
  • get the dimensions of the `element` and assign them to `webview` – gaitat Jul 28 '15 at 12:48
  • possible duplicate of [Chrome Web App webview height issue](http://stackoverflow.com/questions/28194413/chrome-web-app-webview-height-issue) – Sarah Elan Jul 28 '15 at 14:17
  • You should look into the root of the problem (HTML5 100% height). Feel free to edit/comment if that still does not help. – Xan Jul 28 '15 at 16:08
  • possible duplicate of [Why can't I make my div 100% height if I use an HTML5 doctype? How do I get it 100% height](http://stackoverflow.com/questions/10871898/why-cant-i-make-my-div-100-height-if-i-use-an-html5-doctype-how-do-i-get-it-1) – Xan Jul 28 '15 at 16:08
  • @Xan: edited. It's really odd...I can't seem to make the developer tools tell me what's wrong. – moosingin3space Jul 29 '15 at 00:50

0 Answers0