mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 902505 - Set a no-op CSS viewport on Metro to prevent clipping subframes improperly. r=jimm
This commit is contained in:
parent
497f3af283
commit
6cd666f2ca
@ -1312,6 +1312,9 @@ Tab.prototype = {
|
||||
self._eventDeferred = null;
|
||||
}
|
||||
browser.addEventListener("pageshow", onPageShowEvent, true);
|
||||
browser.addEventListener("DOMWindowCreated", this, false);
|
||||
Elements.browsers.addEventListener("SizeChanged", this, false);
|
||||
|
||||
browser.messageManager.addMessageListener("Content:StateChange", this);
|
||||
Services.obs.addObserver(this, "metro_viewstate_changed", false);
|
||||
|
||||
@ -1320,6 +1323,20 @@ Tab.prototype = {
|
||||
this._loadUsingParams(browser, aURI, aParams);
|
||||
},
|
||||
|
||||
updateViewport: function (aEvent) {
|
||||
// <meta name=viewport> is not yet supported; just use the main window size.
|
||||
this.browser.setWindowSize(window.innerWidth, window.innerHeight);
|
||||
},
|
||||
|
||||
handleEvent: function (aEvent) {
|
||||
switch (aEvent.type) {
|
||||
case "DOMWindowCreated":
|
||||
case "SizeChanged":
|
||||
this.updateViewport();
|
||||
break;
|
||||
}
|
||||
},
|
||||
|
||||
receiveMessage: function(aMessage) {
|
||||
switch (aMessage.name) {
|
||||
case "Content:StateChange":
|
||||
@ -1348,6 +1365,8 @@ Tab.prototype = {
|
||||
|
||||
destroy: function destroy() {
|
||||
this._browser.messageManager.removeMessageListener("Content:StateChange", this);
|
||||
this._browser.removeEventListener("DOMWindowCreated", this, false);
|
||||
Elements.browser.removeEventListener("SizeChanged", this, false);
|
||||
Services.obs.removeObserver(this, "metro_viewstate_changed", false);
|
||||
clearTimeout(this._updateThumbnailTimeout);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user