WebExtensions do not honor viewport width of iFrame

RESOLVED INVALID

Status

WebExtensions
Untriaged
RESOLVED INVALID
a year ago
29 days ago

People

(Reporter: bit-dev, Unassigned)

Tracking

53 Branch

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Reporter)

Description

a year ago
Created attachment 8857065 [details]
webextension_vw_bug.png

User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/57.0.2987.133 Safari/537.36

Steps to reproduce:

When migrating our Chrome extension to the WebExtensions platform, we ran into an issue with the UI where it wouldn’t correctly respect the viewport width for the iframe.
 
This was the original relevant CSS:
html, body, iframe {
   width: 100vw;
   height: 100vh;
   margin: 0;
   padding: 0;
   border: 0;
   overflow: hidden;
   display: block;
}
 
#panelHtml {
  height: 600px;
  width: 320px;
}
 
This is the updated CSS to ensure cross browser compatibility:
html, body, iframe {
  height: 100vh;
  margin: 0;
  padding: 0;
  border: 0;
  overflow: hidden;
  display: block;
}
 
#panelHtml {
  height: 600px;
}
 
/* Keep the iframe and container locked to the same width without
relative sizing. This prevents browser variance from effecting the extension. */
#panelHtml, iframe {
  width: 320px;
}

Please note that removing the viewport width style and re-applying after the initial render yields correct results.  The style must be removed and re-applied, however, since opening and closing the extension alone is non-sufficient.


Actual results:

The extension panel opened up as a skinny bar (see attached screenshot).


Expected results:

The extension panel should have inherited it's width (320px) from the viewport of the iFrame.

Updated

a year ago
Component: Untriaged → WebExtensions: Untriaged
Product: Firefox → Toolkit
The size of the viewport is determined by the size of the <body> or root <html> element, depending on whether you're in strict or quirks mode. I'm not sure what behavior you'd expect when giving them values based on viewport size.
Status: UNCONFIRMED → RESOLVED
Last Resolved: a year ago
Resolution: --- → INVALID

Updated

29 days ago
Product: Toolkit → WebExtensions
You need to log in before you can comment on or make changes to this bug.