mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 707285 - Disallow browser.js from overriding viewport size [r=pcwalton]
Don't allow Gecko to set the viewport size because Java knows this better. Allowing this behaviour could result in Bad Things(TM) under certain race conditions such as described in bug 707285.
This commit is contained in:
parent
b6bb536da1
commit
e569e9ae37
@ -130,7 +130,14 @@ public class GeckoSoftwareLayerClient extends LayerClient implements GeckoEventL
|
||||
private void updateViewport(String viewportDescription, final boolean onlyUpdatePageSize) {
|
||||
try {
|
||||
JSONObject viewportObject = new JSONObject(viewportDescription);
|
||||
|
||||
// save and restore the viewport size stored in java; never let the
|
||||
// JS-side viewport dimensions override the java-side ones because
|
||||
// java is the One True Source of this information, and allowing JS
|
||||
// to override can lead to race conditions where this data gets clobbered.
|
||||
FloatSize viewportSize = getLayerController().getViewportSize();
|
||||
mGeckoViewport = new ViewportMetrics(viewportObject);
|
||||
mGeckoViewport.setSize(viewportSize);
|
||||
|
||||
mTileLayer.setOrigin(PointUtils.round(mGeckoViewport.getDisplayportOrigin()));
|
||||
mTileLayer.setResolution(mGeckoViewport.getZoomFactor());
|
||||
|
Loading…
Reference in New Issue
Block a user